I am trying to get a method definition: foo from a class object.
class Bar def foo(required_name, optional="something") puts "Hello args are #{required_name}, #{optional}" end def self.bar puts "I am easy, since I am static" end end
I cannot create an instance of the class, since I need a method definition to evaluate whether I should create an object (application requirements). Bar.class.???(:foo)
I can define bar with Bar.class.method(:bar) , but of course I need foo , thanks!
UPDATE:
Using Ruby 1.8.7
source share