reflection - Ruby class method reference -
in ruby, can reference method , pass in callback-like fashion in same scope this:
my_method = method(:method_name)
how reference class method defined on class?
so if had:
class myclass class << self def my_method // ... stuff end end end
how reference method in different class use in method(...)
call?
answered own question thinking:
you don't need method(...)
@ in case.
instead can use:
myclass.public_method(:my_method)
Comments
Post a Comment