Sha256: ad0ca7cdc57247cd07d85143927a22c66d0f9243732cccd9432bfb656795ec7e

Contents?: true

Size: 554 Bytes

Versions: 5

Compression:

Stored size: 554 Bytes

Contents

module Kernel

  if RUBY_VERSION < "1.8.7"

    # 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

  else

    # 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

end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
facets-2.8.4 lib/core/facets/kernel/object_hexid.rb
facets-2.8.3 lib/core/facets/kernel/object_hexid.rb
facets-2.8.2 lib/core/facets/kernel/object_hexid.rb
facets-2.8.1 lib/core/facets/kernel/object_hexid.rb
facets-2.8.0 lib/core/facets/kernel/object_hexid.rb