Sha256: bbea17df0c1a8bf63d50fcf5f671aaed2fdbdfc3392d712878fc9ce7a3325195

Contents?: true

Size: 672 Bytes

Versions: 25

Compression:

Stored size: 672 Bytes

Contents

class Binding

  # Evaluate a Ruby source code string (or block) in the binding context
  def eval( str ) #='', &blk )
    #if block_given?
    #  Kernel.eval( self, &blk )
    #elsif str
      Kernel.eval( str, self )
    #end
  end

end


#  _____         _
# |_   _|__  ___| |_
#   | |/ _ \/ __| __|
#   | |  __/\__ \ |_
#   |_|\___||___/\__|
#
=begin test

  require 'test/unit'

  class TCBinding < Test::Unit::TestCase

    def setup
      a = 1
      b = 2
      x = "hello"
      # the line number must be updated if it moves
      @bind = binding; @this_line_no = 25
    end

    def test_eval
      assert_equal( "hello", @bind.eval("x") )
    end

  end

=end

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
facets-1.0.0 lib/facet/binding/eval.rb
facets-1.0.3 packages/core/lib/facet/binding/eval.rb
facets-1.3.0 lib/facets/core/binding/eval.rb
facets-1.1.0 lib/facet/binding/eval.rb
facets-1.2.0 lib/facets/core/binding/eval.rb
facets-1.2.1 lib/facets/core/binding/eval.rb
facets-1.3.2 lib/facets/core/binding/eval.rb
facets-1.3.1 lib/facets/core/binding/eval.rb
facets-1.3.3 lib/facets/core/binding/eval.rb
facets-1.4.2 lib/facets/core/binding/eval.rb
facets-1.4.0 lib/facets/core/binding/eval.rb
facets-1.4.1 lib/facets/core/binding/eval.rb
facets-1.4.3 lib/facets/core/binding/eval.rb
facets-1.4.4 lib/facets/core/binding/eval.rb
facets-1.4.5 lib/facets/core/binding/eval.rb
facets-1.7.30 lib/facets/core/binding/eval.rb
facets-1.7.0 lib/facets/core/binding/eval.rb
facets-1.7.38 lib/facets/core/binding/eval.rb
facets-1.7.46 lib/facets/core/binding/eval.rb
facets-1.8.0 lib/facets/core/binding/eval.rb