Class: Pact::ExpectedType
- Inherits:
-
DifferenceIndicator
- Object
- DifferenceIndicator
- Pact::ExpectedType
- Defined in:
- lib/pact/matchers/expected_type.rb
Direct Known Subclasses
Instance Method Summary collapse
- #==(other) ⇒ Object
- #as_json(options = {}) ⇒ Object
- #eq?(other) ⇒ Boolean
-
#initialize(value) ⇒ ExpectedType
constructor
A new instance of ExpectedType.
- #to_json(options = {}) ⇒ Object
- #to_s ⇒ Object
- #type ⇒ Object
Constructor Details
#initialize(value) ⇒ ExpectedType
Returns a new instance of ExpectedType.
6 7 8 |
# File 'lib/pact/matchers/expected_type.rb', line 6 def initialize value @value = value end |
Instance Method Details
#==(other) ⇒ Object
26 27 28 |
# File 'lib/pact/matchers/expected_type.rb', line 26 def == other eq? other end |
#as_json(options = {}) ⇒ Object
18 19 20 |
# File 'lib/pact/matchers/expected_type.rb', line 18 def as_json = {} type end |
#eq?(other) ⇒ Boolean
22 23 24 |
# File 'lib/pact/matchers/expected_type.rb', line 22 def eq? other self.class == other.class && other.type == type end |
#to_json(options = {}) ⇒ Object
14 15 16 |
# File 'lib/pact/matchers/expected_type.rb', line 14 def to_json = {} type end |
#to_s ⇒ Object
30 31 32 |
# File 'lib/pact/matchers/expected_type.rb', line 30 def to_s type end |
#type ⇒ Object
10 11 12 |
# File 'lib/pact/matchers/expected_type.rb', line 10 def type @value.class.name end |