動的継承きもい。

classes = []

class A
	def put
		puts "A"
	end
	def put1
		puts "A"
	end
end

classes << A

class B
	def put
		puts "B"
	end
	def put1
		puts "B"
	end
end

classes << B

class C < [A,B][rand(2)]
	def put1
		puts "C"
	end
end

classes << C

class D < classes[rand(classes.size)]
	def put2
		puts "D"
	end
end

x = D.new

x.put()
x.put1()