Class: Schematist::Validator
- Inherits:
-
Object
- Object
- Schematist::Validator
- Defined in:
- lib/schematist/validator.rb
Constant Summary collapse
- WHITE =
Node states for DFS-based topological sort
:white- GRAY =
No mark (unvisited)
:gray- BLACK =
Temporary mark (currently being processed)
:black
Instance Method Summary collapse
-
#initialize(schema_class) ⇒ Validator
constructor
Permanent mark (completely processed).
- #valid? ⇒ Boolean
- #validate! ⇒ Object
Constructor Details
#initialize(schema_class) ⇒ Validator
Permanent mark (completely processed)
10 11 12 |
# File 'lib/schematist/validator.rb', line 10 def initialize(schema_class) @schema_class = schema_class end |
Instance Method Details
#valid? ⇒ Boolean
19 20 21 22 23 24 |
# File 'lib/schematist/validator.rb', line 19 def valid? validate! true rescue ValidationError false end |
#validate! ⇒ Object
14 15 16 17 |
# File 'lib/schematist/validator.rb', line 14 def validate! validate_circular_references! # Future validations can be added here end |