Class: Openapi3Parser::Validation::InputValidator
- Inherits:
-
Object
- Object
- Openapi3Parser::Validation::InputValidator
- Defined in:
- lib/openapi3_parser/validation/input_validator.rb
Instance Attribute Summary collapse
-
#callable ⇒ Object
readonly
Returns the value of attribute callable.
Instance Method Summary collapse
- #call(validatable) ⇒ Object
-
#initialize(callable) ⇒ InputValidator
constructor
A new instance of InputValidator.
Constructor Details
#initialize(callable) ⇒ InputValidator
Returns a new instance of InputValidator.
8 9 10 |
# File 'lib/openapi3_parser/validation/input_validator.rb', line 8 def initialize(callable) @callable = callable end |
Instance Attribute Details
#callable ⇒ Object (readonly)
Returns the value of attribute callable.
6 7 8 |
# File 'lib/openapi3_parser/validation/input_validator.rb', line 6 def callable @callable end |
Instance Method Details
#call(validatable) ⇒ Object
12 13 14 15 |
# File 'lib/openapi3_parser/validation/input_validator.rb', line 12 def call(validatable) error = callable.call(validatable.input) validatable.add_error(error) if error end |