Sha256: 628c6f5ed70867bb54a2b01c7273c37b4d757543bed6d22587a8eea5d6587b1c
Contents?: true
Size: 584 Bytes
Versions: 22
Compression:
Stored size: 584 Bytes
Contents
require 'facets/core/binding/eval' class Binding # Returns the self in the binding context. def self() @self ||= eval( "self" ) @self 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_self assert_equal( self, @bind.self ) end end =end
Version data entries
22 entries across 22 versions & 1 rubygems