klass = Object.const_set(class_name.capitalize.to_sym,Class.new)
例如,现在我想让 klass 去继承一下 ActiveRecord::Base 我该如何写啊?
把超类作为参数传给 Class.new: http://ruby-doc.org/core-1.9.3/Class.html#method-c-new
Class.new
#1 楼 @5long yes . done it~! thank you ~!