class EasyJSONMatcher::ArrayContentValidator

Attributes

verifier[R]

Public Class Methods

new(verify_with:) click to toggle source
# File lib/easy_json_matcher/array_content_validator.rb, line 6
def initialize(verify_with:)
  @verifier = verify_with
end

Public Instance Methods

call(value:) click to toggle source
# File lib/easy_json_matcher/array_content_validator.rb, line 10
def call(value:)
  errors = []
  value.each do |val|
    # TODO: You could remove the duplication of array content errors here
    errors += verifier.call(value: val)
  end
  errors
end