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.
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_s ⇒ Object
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 |