Class: ObjectComparator::InspectionString

Inherits:
Object
  • Object
show all
Defined in:
lib/object_comparator.rb

Instance Method Summary collapse

Constructor Details

#initialize(string) ⇒ InspectionString

Returns a new instance of InspectionString.



25
26
27
# File 'lib/object_comparator.rb', line 25

def initialize(string)
  @string = string
end

Instance Method Details

#==(other) ⇒ Object



29
30
31
# File 'lib/object_comparator.rb', line 29

def ==(other)
  other.to_s == to_s
end

#to_sObject



33
34
35
36
# File 'lib/object_comparator.rb', line 33

def to_s
  @string.gsub(/:0x[a-z0-9]{14,16} /, ' ')
         .gsub(/:0x[a-z0-9]{14,16}>/, '>')
end