Exception: Zonesync::ValidationError

Inherits:
StandardError
  • Object
show all
Defined in:
lib/zonesync/errors.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initializeValidationError

Returns a new instance of ValidationError.



7
8
9
# File 'lib/zonesync/errors.rb', line 7

def initialize
  @errors = []
end

Instance Attribute Details

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

Returns:

  • (Boolean)


15
16
17
# File 'lib/zonesync/errors.rb', line 15

def any?
  @errors.any?
end

#messageObject



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

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