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.



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

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.



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

def building_node
  @building_node
end

#factoryObject (readonly)

Returns the value of attribute factory.



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

def factory
  @factory
end

#validatableObject (readonly)

Returns the value of attribute validatable.



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

def validatable
  @validatable
end

Class Method Details

.call(*args) ⇒ Object



19
20
21
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 19

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

Instance Method Details

#callObject



29
30
31
32
33
34
35
36
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 29

def call
  check_required_fields
  check_unexpected_fields
  check_mutually_exclusive_fields
  check_invalid_fields
  check_factory_validations
  validatable.collection
end