Class: ObjectComparator::InspectionString
- Inherits:
-
Object
- Object
- ObjectComparator::InspectionString
- Defined in:
- lib/object_comparator.rb
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(string) ⇒ InspectionString
constructor
A new instance of InspectionString.
- #to_s ⇒ Object
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_s ⇒ Object
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 |