How to understand "binding"? Where does it defined?
It's defined in the Kernel module. From "ri Kernel.binding":
···
---------------------------------------------------------
Kernel#binding
binding -> a_binding
------------------------------------------------------------------------
Returns a +Binding+ object, describing the variable and method
bindings at the point of call. This object can be used when
calling
+eval+ to execute the evaluated command in this environment. Also
see the description of class +Binding+.
def getBinding(param)
return binding
end
b = getBinding("hello")
eval("param", b) #=> "hello"
On Sunday 03 July 2005 09:35 am, Greg Chen(China) wrote:
The code is clear, but how to understand "builder.person"? A dynamic
method?
--
-- Jim Weirich jim@weirichhouse.org http://onestepback.org
-----------------------------------------------------------------
"Beware of bugs in the above code; I have only proved it correct,
not tried it." -- Donald Knuth (in a memo to Peter van Emde Boas)