M
Marcin Balinski
Hi
I want to define new method with dynamic name eg:
def method_name
"abrakadabra"
end
define_method(method_name.to_sym){puts "done."}
I cant do it this way, it causes: undefined local variable or method
`method_name'
Is there any other way to achieve this?
I want to define new method with dynamic name eg:
def method_name
"abrakadabra"
end
define_method(method_name.to_sym){puts "done."}
I cant do it this way, it causes: undefined local variable or method
`method_name'
Is there any other way to achieve this?