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
Constant Summary collapse
- OVERRIDDE_FORBIDDEN_METHODS =
[ :original_syntax, :original_syntax_type, :converted_syntax, :converted_syntax_type ]
Instance Attribute Summary collapse
-
#annotation ⇒ Object
readonly
Returns the value of attribute annotation.
-
#converted_syntax_type ⇒ Object
readonly
Returns the value of attribute converted_syntax_type.
-
#original_syntax_type ⇒ Object
readonly
Returns the value of attribute original_syntax_type.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #converted_syntax ⇒ Object
- #hash ⇒ Object
-
#initialize(original_syntax, converted_syntax, annotation = nil) ⇒ Record
constructor
A new instance of Record.
- #original_syntax ⇒ Object
- #to_s ⇒ Object
Constructor Details
#initialize(original_syntax, converted_syntax, annotation = nil) ⇒ Record
Returns a new instance of Record.
16 17 18 19 20 |
# File 'lib/transpec/record.rb', line 16 def initialize(original_syntax, converted_syntax, annotation = nil) @original_syntax_type = original_syntax.to_sym @converted_syntax_type = converted_syntax.to_sym @annotation = annotation end |
Instance Attribute Details
#annotation ⇒ Object (readonly)
Returns the value of attribute annotation.
14 15 16 |
# File 'lib/transpec/record.rb', line 14 def annotation @annotation end |
#converted_syntax_type ⇒ Object (readonly)
Returns the value of attribute converted_syntax_type.
14 15 16 |
# File 'lib/transpec/record.rb', line 14 def converted_syntax_type @converted_syntax_type end |
#original_syntax_type ⇒ Object (readonly)
Returns the value of attribute original_syntax_type.
14 15 16 |
# File 'lib/transpec/record.rb', line 14 def original_syntax_type @original_syntax_type end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
38 39 40 41 42 |
# File 'lib/transpec/record.rb', line 38 def ==(other) self.class == other.class && original_syntax_type == other.original_syntax_type && converted_syntax_type == other.converted_syntax_type end |
#converted_syntax ⇒ Object
26 27 28 |
# File 'lib/transpec/record.rb', line 26 def converted_syntax converted_syntax_type.to_s end |
#hash ⇒ Object
46 47 48 |
# File 'lib/transpec/record.rb', line 46 def hash original_syntax_type.hash ^ converted_syntax_type.hash end |
#original_syntax ⇒ Object
22 23 24 |
# File 'lib/transpec/record.rb', line 22 def original_syntax original_syntax_type.to_s end |
#to_s ⇒ Object
50 51 52 |
# File 'lib/transpec/record.rb', line 50 def to_s "`#{original_syntax_type}` -> `#{converted_syntax_type}`" end |