Sha256: f8a82ab0bb1f45b96796f0b17ecfb7567a539eb512466865e3878567ab3198ee
Contents?: true
Size: 555 Bytes
Versions: 10
Compression:
Stored size: 555 Bytes
Contents
class Object # Returns the object id as a string in hexideciaml, # which is how Ruby reports them with inspect. # # "ABC".object_hexid #=> "0x402d359c" # def object_hexid return "0x" << ('%.x' % (2*self.__id__))[1..-1] end end # _____ _ # |_ _|__ ___| |_ # | |/ _ \/ __| __| # | | __/\__ \ |_ # |_|\___||___/\__| # =begin test require 'test/unit' class TCKernel < Test::Unit::TestCase def test_object_hexid o = Object.new assert( o.inspect.index( o.object_hexid ) ) end end =end
Version data entries
10 entries across 10 versions & 1 rubygems