class RailsParamValidation::ArrayValidator

def matches?(path, data)

def matches?(path, data)
  # Don't proceed if it is not an array at all
  unless data.is_a? Array
    return MatchResult.new nil, path, "Expected an array"
  end
  value = []
  result = MatchResult.new nil
  # Verify each entry
  data.each_with_index do |entry, index|
    match = @inner_validator.matches?(path + [index.to_s], entry)
    if match.matches?
      value.push match.value
    else
      result.merge! match
    end
  end
  result.matches? ? MatchResult.new(value) : result
end