Class Binding
In: lib/core/facets/kernel/callstack.rb
lib/core/facets/binding/caller.rb
lib/core/facets/binding/with.rb
lib/core/facets/binding/self.rb
lib/core/facets/binding/op_get.rb
lib/core/facets/binding/defined.rb
lib/standard/facets/binding/block_exec.rb
Parent: Object

Methods

[]   []=   __DIR__   __FILE__   __LINE__   __callee__   __method__   block_exec   call_stack   caller   callstack   defined?   self   with  

Classes and Modules

Class Binding::BlockEnvironment

Public Instance methods

Returns the value of some variable.

  a = 2
  binding["a"]  #=> 2

Set the value of a local variable.

  binding["a"] = 4
  a  #=> 4

@deprecated No longer wortks in Ruby 1.9+.

@see Binding#with for an alternative.

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

Returns file name in which the binding was created.

Return the line number on which the binding was created.

Retreive the current running method.

Retreive the current running method.

Allows the evaluation of blocks by a Binding in the same way that strings can be evaluated.

  x = 5
  $my_binding = binding

  class Test  # just here to provide a scope gate
    $my_binding.block_exec { x }
  end

  # => 5

NOTE: The implementation of this method uses a method_missing trick.

      Consequently it is a bit of a hack.
call_stack(level=1)

Alias for callstack

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

Returns the call stack, in array format.

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

Returns self of the binding‘s context.

Returns a new binding with local varaibles set.

CREDIT: Trans

[Validate]