Class: Openapi3Parser::Validators::MutuallyExclusiveFields::MutuallyExclusiveFieldErrors
- Inherits:
-
Object
- Object
- Openapi3Parser::Validators::MutuallyExclusiveFields::MutuallyExclusiveFieldErrors
- Defined in:
- lib/openapi3_parser/validators/mutually_exclusive_fields.rb
Instance Method Summary collapse
- #errors ⇒ Object
- #exclusive_errors ⇒ Object
-
#initialize(mutually_exclusive_fields, input) ⇒ MutuallyExclusiveFieldErrors
constructor
A new instance of MutuallyExclusiveFieldErrors.
- #required_errors ⇒ Object
Constructor Details
#initialize(mutually_exclusive_fields, input) ⇒ MutuallyExclusiveFieldErrors
Returns a new instance of MutuallyExclusiveFieldErrors.
66 67 68 69 |
# File 'lib/openapi3_parser/validators/mutually_exclusive_fields.rb', line 66 def initialize(mutually_exclusive_fields, input) @mutually_exclusive_fields = mutually_exclusive_fields @input = input end |
Instance Method Details
#errors ⇒ Object
79 80 81 82 83 84 85 86 87 |
# File 'lib/openapi3_parser/validators/mutually_exclusive_fields.rb', line 79 def errors @errors ||= begin default = { required: [], exclusive: [] } mutually_exclusive_fields .each_with_object(default) do |exclusive, errors| add_error(errors, exclusive) end end end |
#exclusive_errors ⇒ Object
75 76 77 |
# File 'lib/openapi3_parser/validators/mutually_exclusive_fields.rb', line 75 def exclusive_errors errors[:exclusive] end |
#required_errors ⇒ Object
71 72 73 |
# File 'lib/openapi3_parser/validators/mutually_exclusive_fields.rb', line 71 def required_errors errors[:required] end |