Class: Grumlin::QueryValidators::Validator
- Inherits:
-
Object
- Object
- Grumlin::QueryValidators::Validator
- Defined in:
- lib/grumlin/query_validators/validator.rb
Direct Known Subclasses
Defined Under Namespace
Classes: ValidationError
Instance Method Summary collapse
- #valid?(steps) ⇒ Boolean
-
#validate!(steps) ⇒ Object
steps is an instance of ‘Steps` after shortcuts applied.
Instance Method Details
#valid?(steps) ⇒ Boolean
21 22 23 |
# File 'lib/grumlin/query_validators/validator.rb', line 21 def valid?(steps) errors(steps).empty? end |
#validate!(steps) ⇒ Object
steps is an instance of ‘Steps` after shortcuts applied
15 16 17 18 19 |
# File 'lib/grumlin/query_validators/validator.rb', line 15 def validate!(steps) return unless (err = errors(steps)).any? raise ValidationError.new(steps, err) end |