Class: EasyJSONMatcher::ArrayContentValidator
- Inherits:
-
Object
- Object
- EasyJSONMatcher::ArrayContentValidator
- Defined in:
- lib/easy_json_matcher/array_content_validator.rb
Instance Attribute Summary collapse
-
#next_step ⇒ Object
readonly
Returns the value of attribute next_step.
-
#verifier ⇒ Object
readonly
Returns the value of attribute verifier.
Instance Method Summary collapse
- #>>(step) ⇒ Object
- #call(value:) ⇒ Object
-
#initialize(verify_with:) ⇒ ArrayContentValidator
constructor
A new instance of ArrayContentValidator.
Constructor Details
#initialize(verify_with:) ⇒ ArrayContentValidator
Returns a new instance of ArrayContentValidator.
6 7 8 |
# File 'lib/easy_json_matcher/array_content_validator.rb', line 6 def initialize(verify_with:) @verifier = verify_with end |
Instance Attribute Details
#next_step ⇒ Object (readonly)
Returns the value of attribute next_step.
4 5 6 |
# File 'lib/easy_json_matcher/array_content_validator.rb', line 4 def next_step @next_step end |
#verifier ⇒ Object (readonly)
Returns the value of attribute verifier.
4 5 6 |
# File 'lib/easy_json_matcher/array_content_validator.rb', line 4 def verifier @verifier end |
Instance Method Details
#>>(step) ⇒ Object
18 19 20 |
# File 'lib/easy_json_matcher/array_content_validator.rb', line 18 def >> (step) @next_step = step end |
#call(value:) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/easy_json_matcher/array_content_validator.rb', line 10 def call(value:) errors = [] value.each do |val| errors += verifier.call(value: val) end errors end |