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, error_key, prefix) ⇒ ExpectedValue
constructor
A new instance of ExpectedValue.
Constructor Details
#initialize(match_function, expected_instance, error_key, prefix) ⇒ ExpectedValue
Returns a new instance of ExpectedValue.
7 8 9 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 7 def initialize(match_function, expected_instance, error_key, prefix) @value = fetch_expected_value(expected_instance, match_function, error_key, prefix) end |
Instance Attribute Details
#value ⇒ Object (readonly)
Returns the value of attribute value.
6 7 8 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 6 def value @value end |
Instance Method Details
#==(other) ⇒ Object
11 12 13 14 |
# File 'lib/json_rspec_match_maker/expected_value.rb', line 11 def ==(other) raise ArgumentError unless other.is_a? TargetValue other.value == value end |