Class: Aho::Schema::Validator
- Inherits:
-
Object
- Object
- Aho::Schema::Validator
- Defined in:
- lib/aho/schema/validator.rb
Constant Summary collapse
- TYPES =
{ 'string' => String, 'number' => Numeric, 'integer' => Integer, 'boolean' => [TrueClass, FalseClass], 'array' => Array, 'object' => Hash }.freeze
Instance Method Summary collapse
-
#initialize(body, schema, parent_key = nil) ⇒ Validator
constructor
A new instance of Validator.
- #validate! ⇒ Object
Constructor Details
#initialize(body, schema, parent_key = nil) ⇒ Validator
Returns a new instance of Validator.
15 16 17 18 19 |
# File 'lib/aho/schema/validator.rb', line 15 def initialize(body, schema, parent_key = nil) @body = body @schema = schema @parent_key = parent_key end |
Instance Method Details
#validate! ⇒ Object
21 22 23 24 25 |
# File 'lib/aho/schema/validator.rb', line 21 def validate! validate_required_fields! validate_properties! true end |