Parent

Binding

Public Instance Methods

[]( x ) click to toggle source

Returns the value of some variable.

  a = 2
  binding["a"]  #=> 2
    # File lib/core/facets/binding/opvars.rb, line 10
10:   def []( x )
11:     eval( x.to_s )
12:   end
[]=( l, v ) click to toggle source

Set the value of a local variable.

  binding["a"] = 4
  a  #=> 4
    # File lib/core/facets/binding/opvars.rb, line 19
19:   def []=( l, v )
20:     eval( "lambda {|v| #{l} = v}").call( v )
21:   end
__DIR__() click to toggle source

Return the directory of the file in which the binding was created.

    # File lib/core/facets/binding/caller.rb, line 26
26:   def __DIR__  
27:     File.dirname(self.__FILE__)
28:   end
__FILE__() click to toggle source

Returns file name in which the binding was created.

    # File lib/core/facets/binding/caller.rb, line 20
20:   def __FILE__
21:     Kernel.eval("__FILE__", self)
22:   end
__LINE__() click to toggle source

Return the line number on which the binding was created.

    # File lib/core/facets/binding/caller.rb, line 14
14:   def __LINE__
15:     Kernel.eval("__LINE__", self)
16:   end
__callee__() click to toggle source

Retreive the current running method.

    # File lib/core/facets/binding/caller.rb, line 32
32:   def __callee__
33:     Kernel.eval("__callee__", self)
34:   end
__method__() click to toggle source

Retreive the current running method.

    # File lib/core/facets/binding/caller.rb, line 38
38:   def __method__
39:     Kernel.eval("__method__", self)
40:   end
caller( skip=0 ) click to toggle source

Returns the call stack, same format as Kernel#caller()

    # File lib/core/facets/binding/caller.rb, line 8
 8:   def caller( skip=0 )
 9:     eval("caller(#{skip})")
10:   end
callstack(level=1) click to toggle source

Returns the call stack, in array format.

    # File lib/core/facets/kernel/callstack.rb, line 47
47:   def callstack(level=1)
48:     eval( "callstack( #{level} )" )
49:   end
defined?(x) click to toggle source

Returns the nature of something within the context of the binding. Returns nil if that thing is not defined.

   # File lib/core/facets/binding/defined.rb, line 7
7:   def defined?(x)
8:     eval("defined? #{x}")
9:   end
eval(str) click to toggle source

Evaluate a Ruby source code string (or block) in the binding context.

    # File lib/core/facets/binding/eval.rb, line 7
 7:     def eval(str) #='', &blk )
 8:       #if block_given?
 9:       #  Kernel.eval( self, &blk )
10:       #elsif str
11:         Kernel.eval(str, self)
12:       #end
13:     end
local_variables() click to toggle source

Returns the local variables defined in the binding context

  a = 2
  binding.local_variables  #=> ["a"]
    # File lib/core/facets/binding/local_variables.rb, line 10
10:   def local_variables()
11:     eval("local_variables")
12:   end
self() click to toggle source

Returns self of the binding context.

   # File lib/core/facets/binding/self.rb, line 7
7:   def self()
8:     @_self ||= eval("self")
9:   end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.