Class: HDL::Parser::Validator
- Inherits:
-
Object
- Object
- HDL::Parser::Validator
- Defined in:
- lib/hdl/parser/validator.rb
Direct Known Subclasses
Defined Under Namespace
Classes: InputValidator, SchemaValidator, TableValidator
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(hash) ⇒ Validator
constructor
A new instance of Validator.
- #validate! ⇒ Object
Constructor Details
#initialize(hash) ⇒ Validator
Returns a new instance of Validator.
7 8 9 |
# File 'lib/hdl/parser/validator.rb', line 7 def initialize(hash) @hash = hash end |
Class Method Details
.validate!(hash) ⇒ Object
3 4 5 |
# File 'lib/hdl/parser/validator.rb', line 3 def self.validate!(hash) new(hash).validate! end |
Instance Method Details
#validate! ⇒ Object
11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/hdl/parser/validator.rb', line 11 def validate! InputValidator.validate!(@hash) if @hash[:schema] validator = SchemaValidator else validator = TableValidator end validator.validate!(@hash) end |