Start with the following scenario:
class Foo
def bar(baz={})
p baz
end
end
foo = Foo.new
p meth = foo.method(:bar) # => #<Method: Foo#bar>
p meth.parameters # => [[:opt, :baz]]
So I can figure out that the method bar
is optional, but how do I find the default value ({}
) for the method?