Class: Commons::Lang::ObjectUtils

Inherits:
Object
  • Object
show all
Defined in:
lib/commons/lang/object_utils.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeObjectUtils

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