Class: CyclicObjectMembersValidation

Inherits:
ObjectMembersValidation show all
Defined in:
lib/json_patterns.rb

Constant Summary collapse

@@references =
{}
@@count =
0

Constants included from Inspectable

Inspectable::INSPECTING_KEY

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods inherited from ObjectMembersValidation

memoized_new_from_pattern

Methods included from Inspectable

#inspect

Constructor Details

#initialize(opts) ⇒ CyclicObjectMembersValidation

Returns a new instance of CyclicObjectMembersValidation.



927
928
929
930
931
# File 'lib/json_patterns.rb', line 927

def initialize(opts)
  super(opts)
  @@count += 1
  @@references[self] = @@count
end

Instance Attribute Details

#membersObject

Returns the value of attribute members.



923
924
925
# File 'lib/json_patterns.rb', line 923

def members
  @members
end

Instance Method Details

#first_value_match?(name, value) ⇒ Boolean

Returns:



941
942
943
# File 'lib/json_patterns.rb', line 941

def first_value_match?(name, value)
  @members.first_value_match?(name, value)
end

#first_value_validations(name) ⇒ Object



945
946
947
# File 'lib/json_patterns.rb', line 945

def first_value_validations(name)
  @members.first_value_validations(name)
end

#matching_first_names(data) ⇒ Object



937
938
939
# File 'lib/json_patterns.rb', line 937

def matching_first_names(data)
  @members.matching_first_names(data)
end

#possible_first_namesObject



933
934
935
# File 'lib/json_patterns.rb', line 933

def possible_first_names
  @members.possible_first_names
end

#to_sObject



953
954
955
# File 'lib/json_patterns.rb', line 953

def to_s
  "&:#{@@references[self]}"
end

#validate_members(path, data) ⇒ Object



949
950
951
# File 'lib/json_patterns.rb', line 949

def validate_members(path, data)
  @members.validate_members(path, data)
end