Class: Valcro::Runner
- Inherits:
-
Object
- Object
- Valcro::Runner
- Defined in:
- lib/valcro/runner.rb
Instance Attribute Summary collapse
-
#error_list ⇒ Object
Returns the value of attribute error_list.
-
#validators ⇒ Object
Returns the value of attribute validators.
Instance Method Summary collapse
- #add_validator(validator) ⇒ Object
-
#initialize(error_list = ErrorList.new) ⇒ Runner
constructor
A new instance of Runner.
- #validate ⇒ Object
Constructor Details
Instance Attribute Details
#error_list ⇒ Object
Returns the value of attribute error_list.
3 4 5 |
# File 'lib/valcro/runner.rb', line 3 def error_list @error_list end |
#validators ⇒ Object
Returns the value of attribute validators.
3 4 5 |
# File 'lib/valcro/runner.rb', line 3 def validators @validators end |
Instance Method Details
#add_validator(validator) ⇒ Object
9 10 11 |
# File 'lib/valcro/runner.rb', line 9 def add_validator(validator) @validators << validator end |
#validate ⇒ Object
13 14 15 16 17 |
# File 'lib/valcro/runner.rb', line 13 def validate @validators.each do |validator| validator.call error_list end end |