Class: SequencedObjectMembersValidation
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
#left ⇒ Object
TODO: Use an array instead of :left and :right. Easier to process, easier to inspect.
Obviates the need for an EmptyObjectMembersValidation in some cases.
693
694
695
|
# File 'lib/json_patterns.rb', line 693
def left
@left
end
|
#right ⇒ Object
TODO: Use an array instead of :left and :right. Easier to process, easier to inspect.
Obviates the need for an EmptyObjectMembersValidation in some cases.
693
694
695
|
# File 'lib/json_patterns.rb', line 693
def right
@right
end
|
Instance Method Details
#first_value_match?(name, value) ⇒ Boolean
707
708
709
|
# File 'lib/json_patterns.rb', line 707
def first_value_match?(name, value)
@left.first_value_match?(name, value)
end
|
#first_value_validation ⇒ Object
699
700
701
|
# File 'lib/json_patterns.rb', line 699
def first_value_validation
@left.first_value_validation
end
|
#first_value_validations(name) ⇒ Object
711
712
713
|
# File 'lib/json_patterns.rb', line 711
def first_value_validations(name)
@left.first_value_validations(name)
end
|
#matching_first_names(data) ⇒ Object
703
704
705
|
# File 'lib/json_patterns.rb', line 703
def matching_first_names(data)
@left.matching_first_names(data)
end
|
#possible_first_names ⇒ Object
695
696
697
|
# File 'lib/json_patterns.rb', line 695
def possible_first_names
@left.possible_first_names
end
|
#to_s ⇒ Object
724
725
726
|
# File 'lib/json_patterns.rb', line 724
def to_s
[@left.to_s, @right.to_s].select { |s| not s.empty? }.join(', ')
end
|
#validate_members(path, data) ⇒ Object
715
716
717
718
719
720
721
722
|
# File 'lib/json_patterns.rb', line 715
def validate_members(path, data)
result_left = @left.validate_members(path, data)
result_right = @right.validate_members(path, result_left.remainder)
return ObjectMembersValidationResult.new(
failures: result_left.failures + result_right.failures,
remainder: result_right.remainder,
)
end
|