Class: WipeOut::ValidationResult
- Inherits:
-
Object
- Object
- WipeOut::ValidationResult
- Defined in:
- lib/wipe_out/validate.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #add_error(message) ⇒ Object
-
#initialize ⇒ ValidationResult
constructor
A new instance of ValidationResult.
- #valid? ⇒ Boolean
Constructor Details
#initialize ⇒ ValidationResult
Returns a new instance of ValidationResult.
36 37 38 |
# File 'lib/wipe_out/validate.rb', line 36 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
34 35 36 |
# File 'lib/wipe_out/validate.rb', line 34 def errors @errors end |
Instance Method Details
#add_error(message) ⇒ Object
44 45 46 |
# File 'lib/wipe_out/validate.rb', line 44 def add_error() @errors << end |
#valid? ⇒ Boolean
40 41 42 |
# File 'lib/wipe_out/validate.rb', line 40 def valid? !errors.any? end |