Returns the value of some variable.
require 'facet/binding/local_variables' a = 2 binding["a"] #=> 2
Returns the value of some variable.
require 'facet/binding/local_variables' a = 2 binding["a"] #=> 2
Retreive the current running method.
require 'facet/binding/called' def tester; p called; end tester #=> :tester
Returns the local variables defined in the binding context
require 'facet/binding/local_variables' a = 2 binding.local_varibales #=> ["a"]
There is a lot of debate on what to call this. method_name differs from called only by the fact that it returns a string, rather then a symbol.
require 'facet/binding/called' def tester; p method_name; end tester #=> "tester"