Ruby 动态创建的类,怎么去继承别的类啊

jarorwar · August 14, 2013 · Last by jarorwar replied at August 14, 2013 · 3507 hits

klass = Object.const_set(class_name.capitalize.to_sym,Class.new)

例如,现在我想让 klass 去继承一下 ActiveRecord::Base 我该如何写啊?

#1 楼 @5long yes . done it~! thank you ~!

You need to Sign in before reply, if you don't have an account, please Sign up first.