Class: ManyObjectMembersValidation
Constant Summary
Constants included
from Inspectable
Inspectable::INSPECTING_KEY
Instance Attribute Summary collapse
Instance Method Summary
collapse
memoized_new_from_pattern
#initialize
#inspect
Instance Attribute Details
#value_validation ⇒ Object
Returns the value of attribute value_validation.
842
843
844
|
# File 'lib/json_patterns.rb', line 842
def value_validation
@value_validation
end
|
Instance Method Details
#first_value_match?(name, value) ⇒ Boolean
853
854
855
|
# File 'lib/json_patterns.rb', line 853
def first_value_match?(name, value)
@value_validation.validate([], value).empty?
end
|
#first_value_validations(name) ⇒ Object
857
858
859
|
# File 'lib/json_patterns.rb', line 857
def first_value_validations(name)
Set[@value_validation]
end
|
#matching_first_names(data) ⇒ Object
849
850
851
|
# File 'lib/json_patterns.rb', line 849
def matching_first_names(data)
Set[*data.keys]
end
|
#possible_first_names ⇒ Object
844
845
846
847
|
# File 'lib/json_patterns.rb', line 844
def possible_first_names
Set[]
end
|
#to_s ⇒ Object
861
862
863
|
# File 'lib/json_patterns.rb', line 861
def to_s
"__: #{@value_validation}, ..."
end
|
#validate_members(path, data) ⇒ Object
865
866
867
868
869
870
871
872
873
874
875
|
# File 'lib/json_patterns.rb', line 865
def validate_members(path, data)
failures = []
data = data.to_a
for i in 0..(data.length-1)
failures += @value_validation.validate(path + [data[i][0]], data[i][1])
end
return ObjectMembersValidationResult.new(
failures: failures,
remainder: {},
)
end
|