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.



11
12
13
# File 'lib/object_comparator.rb', line 11

def initialize(string)
  @string = string
end

Instance Method Details

#==(other) ⇒ Object



15
16
17
# File 'lib/object_comparator.rb', line 15

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

#to_sObject



19
20
21
22
# File 'lib/object_comparator.rb', line 19

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