Exception: Zonesync::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Zonesync::ValidationError
- Defined in:
- lib/zonesync/errors.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Instance Method Summary collapse
- #add(error) ⇒ Object
- #any? ⇒ Boolean
-
#initialize ⇒ ValidationError
constructor
A new instance of ValidationError.
- #message ⇒ Object
Constructor Details
#initialize ⇒ ValidationError
Returns a new instance of ValidationError.
7 8 9 |
# File 'lib/zonesync/errors.rb', line 7 def initialize @errors = [] end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
23 24 25 |
# File 'lib/zonesync/errors.rb', line 23 def errors @errors end |
Instance Method Details
#add(error) ⇒ Object
11 12 13 |
# File 'lib/zonesync/errors.rb', line 11 def add(error) @errors << error end |
#any? ⇒ Boolean
15 16 17 |
# File 'lib/zonesync/errors.rb', line 15 def any? @errors.any? end |
#message ⇒ Object
19 20 21 |
# File 'lib/zonesync/errors.rb', line 19 def @errors.map(&:message).join("\n\n#{'-' * 60}\n\n") end |