Class: Transpec::Record
- Inherits:
-
Object
- Object
- Transpec::Record
- Defined in:
- lib/transpec/record.rb
Direct Known Subclasses
Instance Attribute Summary collapse
-
#converted_syntax ⇒ Object
readonly
Returns the value of attribute converted_syntax.
-
#original_syntax ⇒ Object
readonly
Returns the value of attribute original_syntax.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize(original_syntax, converted_syntax) ⇒ Record
constructor
A new instance of Record.
- #to_s ⇒ Object
Constructor Details
#initialize(original_syntax, converted_syntax) ⇒ Record
Returns a new instance of Record.
7 8 9 10 |
# File 'lib/transpec/record.rb', line 7 def initialize(original_syntax, converted_syntax) @original_syntax = original_syntax @converted_syntax = converted_syntax end |
Instance Attribute Details
#converted_syntax ⇒ Object (readonly)
Returns the value of attribute converted_syntax.
5 6 7 |
# File 'lib/transpec/record.rb', line 5 def converted_syntax @converted_syntax end |
#original_syntax ⇒ Object (readonly)
Returns the value of attribute original_syntax.
5 6 7 |
# File 'lib/transpec/record.rb', line 5 def original_syntax @original_syntax end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
12 13 14 15 16 |
# File 'lib/transpec/record.rb', line 12 def ==(other) self.class == other.class && original_syntax == other.original_syntax && converted_syntax == other.converted_syntax end |
#hash ⇒ Object
20 21 22 |
# File 'lib/transpec/record.rb', line 20 def hash original_syntax.hash ^ converted_syntax.hash end |
#to_s ⇒ Object
24 25 26 |
# File 'lib/transpec/record.rb', line 24 def to_s "`#{original_syntax}` -> `#{converted_syntax}`" end |