Class: ATP::Validator
Direct Known Subclasses
ATP::Validators::DuplicateIDs, ATP::Validators::Jobs, ATP::Validators::MissingIDs
Instance Attribute Summary collapse
-
#flow ⇒ Object
readonly
Returns the value of attribute flow.
Instance Method Summary collapse
-
#initialize(flow) ⇒ Validator
constructor
A new instance of Validator.
- #process(node) ⇒ Object
- #setup ⇒ Object
-
#test_process(node) ⇒ Object
For test purposes, returns true if validation failed rather than exiting the process.
Methods inherited from Processor
#handler_missing, #n, #n0, #n1, #run
Constructor Details
#initialize(flow) ⇒ Validator
Returns a new instance of Validator.
6 7 8 |
# File 'lib/atp/validator.rb', line 6 def initialize(flow) @flow = flow end |
Instance Attribute Details
#flow ⇒ Object (readonly)
Returns the value of attribute flow.
4 5 6 |
# File 'lib/atp/validator.rb', line 4 def flow @flow end |
Instance Method Details
#process(node) ⇒ Object
10 11 12 13 14 15 16 17 18 19 20 21 |
# File 'lib/atp/validator.rb', line 10 def process(node) if @top_level_called super else @top_level_called = true setup super(node) unless @testing exit 1 if on_completion end end end |
#setup ⇒ Object
31 32 |
# File 'lib/atp/validator.rb', line 31 def setup end |
#test_process(node) ⇒ Object
For test purposes, returns true if validation failed rather than exiting the process
25 26 27 28 29 |
# File 'lib/atp/validator.rb', line 25 def test_process(node) @testing = true process(node) on_completion end |