Class: Transpec::Record
- Inherits:
-
Object
- Object
- Transpec::Record
- Defined in:
- lib/transpec/record.rb
Direct Known Subclasses
Syntax::Have::HaveRecord, Syntax::MethodStub::AllowRecord, Syntax::MethodStub::DeprecatedMethodRecord, Syntax::MethodStub::NoMessageAllowanceRecord, Syntax::Mixin::AnyInstanceBlock::AnyInstanceBlockRecord, Syntax::Mixin::UselessAndReturn::UselessAndReturnRecord, Syntax::ShouldReceive::ExpectBaseRecord, Syntax::ShouldReceive::StubRecord
Instance Attribute Summary collapse
-
#annotation ⇒ Object
readonly
Returns the value of attribute annotation.
-
#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, annotation = nil) ⇒ Record
constructor
A new instance of Record.
- #to_s ⇒ Object
Constructor Details
#initialize(original_syntax, converted_syntax, annotation = nil) ⇒ Record
Returns a new instance of Record.
9 10 11 12 13 |
# File 'lib/transpec/record.rb', line 9 def initialize(original_syntax, converted_syntax, annotation = nil) @original_syntax = original_syntax @converted_syntax = converted_syntax @annotation = annotation end |
Instance Attribute Details
#annotation ⇒ Object (readonly)
Returns the value of attribute annotation.
7 8 9 |
# File 'lib/transpec/record.rb', line 7 def annotation @annotation end |
#converted_syntax ⇒ Object (readonly)
Returns the value of attribute converted_syntax.
7 8 9 |
# File 'lib/transpec/record.rb', line 7 def converted_syntax @converted_syntax end |
#original_syntax ⇒ Object (readonly)
Returns the value of attribute original_syntax.
7 8 9 |
# File 'lib/transpec/record.rb', line 7 def original_syntax @original_syntax end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
15 16 17 18 19 |
# File 'lib/transpec/record.rb', line 15 def ==(other) self.class == other.class && original_syntax == other.original_syntax && converted_syntax == other.converted_syntax end |
#hash ⇒ Object
23 24 25 |
# File 'lib/transpec/record.rb', line 23 def hash original_syntax.hash ^ converted_syntax.hash end |
#to_s ⇒ Object
27 28 29 |
# File 'lib/transpec/record.rb', line 27 def to_s "`#{original_syntax}` -> `#{converted_syntax}`" end |