Class: Openapi3Parser::NodeFactory::ObjectFactory::Validator

Inherits:
Object
  • Object
show all
Defined in:
lib/openapi3_parser/node_factory/object_factory/validator.rb

Defined Under Namespace

Classes: CheckFactoryValidations, CheckInvalidFields

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(factory, building_node) ⇒ Validator

Returns a new instance of Validator.



16
17
18
19
20
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 16

def initialize(factory, building_node)
  @factory = factory
  @building_node = building_node
  @validatable = Validation::Validatable.new(factory)
end

Instance Attribute Details

#building_nodeObject (readonly)

Returns the value of attribute building_node.



10
11
12
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 10

def building_node
  @building_node
end

#factoryObject (readonly)

Returns the value of attribute factory.



10
11
12
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 10

def factory
  @factory
end

#validatableObject (readonly)

Returns the value of attribute validatable.



10
11
12
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 10

def validatable
  @validatable
end

Class Method Details

.call(*args) ⇒ Object



12
13
14
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 12

def self.call(*args)
  new(*args).call
end

Instance Method Details

#callObject



22
23
24
25
26
27
28
29
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 22

def call
  check_required_fields
  check_unexpected_fields
  check_mutually_exclusive_fields
  check_invalid_fields
  check_factory_validations
  validatable.collection
end