Module: Dux::InspectID
Overview
Calculate the object's inspection id
Class Method Summary collapse
-
.inspect_id(object = self) ⇒ String
Calculates the id shown in the default version of
#inspectmethods.
Instance Method Summary collapse
-
#inspect_id(object = self) ⇒ String
Calculates the id shown in the default version of
#inspectmethods.
Class Method Details
.inspect_id(object = self) ⇒ String
Note:
This is currently limited to the implementation used in MRI. Rubinius and JRuby have their own implementations that are not currently served by this.
Calculates the id shown in the default
version of #inspect methods.
13 14 15 |
# File 'lib/dux/inspect_id.rb', line 13 def inspect_id(object = self) "0x%0.14x" % ( object.object_id << 1 ) end |
Instance Method Details
#inspect_id(object = self) ⇒ String
Note:
This is currently limited to the implementation used in MRI. Rubinius and JRuby have their own implementations that are not currently served by this.
Calculates the id shown in the default
version of #inspect methods.
13 14 15 |
# File 'lib/dux/inspect_id.rb', line 13 def inspect_id(object = self) "0x%0.14x" % ( object.object_id << 1 ) end |