Exception: Zonesync::ValidationError
- Inherits:
-
StandardError
- Object
- StandardError
- Zonesync::ValidationError
- Extended by:
- T::Sig
- 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.
10 11 12 |
# File 'lib/zonesync/errors.rb', line 10 def initialize @errors = T.let([], T::Array[StandardError]) end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
30 31 32 |
# File 'lib/zonesync/errors.rb', line 30 def errors @errors end |
Instance Method Details
#add(error) ⇒ Object
15 16 17 |
# File 'lib/zonesync/errors.rb', line 15 def add(error) @errors << error end |
#any? ⇒ Boolean
20 21 22 |
# File 'lib/zonesync/errors.rb', line 20 def any? @errors.any? end |
#message ⇒ Object
25 26 27 |
# File 'lib/zonesync/errors.rb', line 25 def @errors.map(&:message).join("\n\n#{'-' * 60}\n\n") end |