Adrian Klingel wrote:
> Ahhh, I'm missing the "self"
Ahhh, I guess you don't need this then:
module Foo
module Bar
def mymethod
"xyz"
end
end
end
str = "Foo::Bar::mymethod"
pieces = str.split("::")
method_name = pieces.pop
module_name = pieces.join("::")
mod = eval(module_name)
mod.module_eval do
module_function method_name.to_sym
end
puts mod.module_eval(method_name)
--
Posted via http://www.ruby-forum.com/.