Class: Openapi3Parser::NodeFactory::ObjectFactory::Validator
- Inherits:
-
Object
- Object
- Openapi3Parser::NodeFactory::ObjectFactory::Validator
- Defined in:
- lib/openapi3_parser/node_factory/object_factory/validator.rb
Defined Under Namespace
Classes: CheckFactoryValidations, CheckInvalidFields
Instance Attribute Summary collapse
-
#factory ⇒ Object
readonly
Returns the value of attribute factory.
-
#raise_on_invalid ⇒ Object
readonly
Returns the value of attribute raise_on_invalid.
-
#validatable ⇒ Object
readonly
Returns the value of attribute validatable.
Class Method Summary collapse
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(factory, raise_on_invalid: false) ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize(factory, raise_on_invalid: false) ⇒ 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, raise_on_invalid: false) @factory = factory @raise_on_invalid = raise_on_invalid @validatable = Validation::Validatable.new(factory) end |
Instance Attribute Details
#factory ⇒ Object (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 |
#raise_on_invalid ⇒ Object (readonly)
Returns the value of attribute raise_on_invalid.
10 11 12 |
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 10 def raise_on_invalid @raise_on_invalid end |
#validatable ⇒ Object (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, **kwargs) ⇒ Object
12 13 14 |
# File 'lib/openapi3_parser/node_factory/object_factory/validator.rb', line 12 def self.call(*args, **kwargs) new(*args, **kwargs).call end |
Instance Method Details
#call ⇒ Object
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 |