Class: OpenapiBlocks::Schema::Validator
- Inherits:
-
Object
- Object
- OpenapiBlocks::Schema::Validator
- Defined in:
- lib/openapi_blocks/schema/validator.rb
Overview
rubocop:disable Style/Documentation
Instance Method Summary collapse
- #extract ⇒ Object
-
#initialize(model) ⇒ Validator
constructor
A new instance of Validator.
Constructor Details
#initialize(model) ⇒ Validator
Returns a new instance of Validator.
6 7 8 |
# File 'lib/openapi_blocks/schema/validator.rb', line 6 def initialize(model) @model = model end |
Instance Method Details
#extract ⇒ Object
10 11 12 13 14 15 16 17 |
# File 'lib/openapi_blocks/schema/validator.rb', line 10 def extract @model.validators.each_with_object({}) do |validator, hash| validator.attributes.each do |attribute| hash[attribute.to_s] ||= {} hash[attribute.to_s].merge!(convert(validator)) end end end |