binding

prc.binding â binding
Instance Public methods

Returns the binding associated with prc. Note that Kernel#eval accepts either a Proc or a Binding object as its second parameter.

def fred(param)
  proc {}
end

b = fred(99)
eval("param", b.binding)   #=> 99
doc_ruby_on_rails
2015-04-28 15:28:53
Comments
Leave a Comment

Please login to continue.