我想这样做如下: class String
def fancy_thing appendix
# Just a trivial example to ensure self and params work.
# Pretend this is something complex.
self.reverse + appendix
end
end
我有一个模块MyModule。我动态加载类到它。我如何获得在其名称空间中定义的类的列表? 例子: def load_plugins
Dir.glob(File.dirname(__FILE__) + '/plugins/*.rb') do |f|
MyModule.class_eval File.read(f)
end
# now how can I fi