Exception: Zonesync::ValidationError

Inherits:
StandardError
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/zonesync/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidationError

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

#errorsObject (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

Returns:

  • (Boolean)


20
21
22
# File 'lib/zonesync/errors.rb', line 20

def any?
  @errors.any?
end

#messageObject



25
26
27
# File 'lib/zonesync/errors.rb', line 25

def message
  @errors.map(&:message).join("\n\n#{'-' * 60}\n\n")
end