Class: Commons::Lang::ObjectUtils
- Inherits:
-
Object
- Object
- Commons::Lang::ObjectUtils
- Defined in:
- lib/commons/lang/object_utils.rb
Class Method Summary collapse
-
.append_identity_to_s(buffer, object) ⇒ Object
Append the object id (hex string) to the given string.
Instance Method Summary collapse
-
#initialize ⇒ ObjectUtils
constructor
A new instance of ObjectUtils.
Constructor Details
#initialize ⇒ ObjectUtils
Returns a new instance of ObjectUtils.
38 39 40 |
# File 'lib/commons/lang/object_utils.rb', line 38 def initialize super() end |
Class Method Details
.append_identity_to_s(buffer, object) ⇒ Object
Append the object id (hex string) to the given string.
buffer
-
string buffer.
object
-
a instance.
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/commons/lang/object_utils.rb', line 46 def self.append_identity_to_s(buffer, object) if object == nil return nil end if buffer == nil buffer = String.new('') end return buffer.concat( '#<' + object.class.name + ':0x' + object.__id__.to_s(16) + '>') end |