--- !ruby/object:RI::ClassDescription
attributes: []
class_methods: []
comment:
- !ruby/struct:SM::Flow::P
body: Objects of class Binding encapsulate the execution context at some particular place in the code and retain this context for future use. The variables, methods, value of self, and possibly an iterator block that can be accessed in this context are all retained. Binding objects can be created using Kernel#binding, and are made available to the callback of Kernel#set_trace_func.
- !ruby/struct:SM::Flow::P
body: These binding objects can be passed as the second argument of the Kernel#eval method, establishing an environment for the evaluation.
- !ruby/struct:SM::Flow::VERB
body: " class Demo\n def initialize(n)\n @secret = n\n end\n def getBinding\n return binding()\n end\n end\n\n k1 = Demo.new(99)\n b1 = k1.getBinding\n k2 = Demo.new(-3)\n b2 = k2.getBinding\n\n eval("@secret", b1) #=> 99\n eval("@secret", b2) #=> -3\n eval("@secret") #=> nil\n"
- !ruby/struct:SM::Flow::P
body: Binding objects have no class-specific methods.
constants: []
full_name: Binding
includes: []
instance_methods:
- !ruby/object:RI::MethodSummary
name: clone
- !ruby/object:RI::MethodSummary
name: eval
name: Binding
superclass: Object