Class: JsonRspecMatchMaker::ExpectedValue
- Inherits:
-
Object
- Object
- JsonRspecMatchMaker::ExpectedValue
- Defined in:
- lib/json_rspec_match_maker/expected_value.rb
Overview
Handles fetching the expected value from the expected instance
Instance Attribute Summary collapse
-
#value ⇒ Object
readonly
Returns the value of attribute value.
Instance Method Summary collapse
- #==(other) ⇒ Object
-
#initialize(match_function, expected_instance) ⇒ ExpectedValue
constructor
A new instance of ExpectedValue.
Constructor Details
#initialize(match_function, expected_instance) ⇒ ExpectedValue
Returns a new instance of ExpectedValue.
5 6 7 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 5 def initialize(match_function, expected_instance) @value = match_function.call(expected_instance) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
4 5 6 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 4 def value @value end |
Instance Method Details
#==(other) ⇒ Object
9 10 11 12 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 9 def ==(other) raise ArgumentError unless other.is_a? TargetValue other.value == value end |