Exception: R10K::Settings::Collection::ValidationError

Inherits:
Error
  • Object
show all
Defined in:
lib/r10k/settings/collection.rb

Instance Attribute Summary collapse

Attributes inherited from Error

#original

Instance Method Summary collapse

Methods inherited from Error

wrap

Constructor Details

#initialize(mesg, options = {}) ⇒ ValidationError

Returns a new instance of ValidationError.



107
108
109
110
# File 'lib/r10k/settings/collection.rb', line 107

def initialize(mesg, options = {})
  super
  @errors = options[:errors]
end

Instance Attribute Details

#errorsObject (readonly)

Returns the value of attribute errors.



105
106
107
# File 'lib/r10k/settings/collection.rb', line 105

def errors
  @errors
end

Instance Method Details

#formatObject



112
113
114
115
116
117
118
119
# File 'lib/r10k/settings/collection.rb', line 112

def format
  struct = []
  struct << "#{message}:"
  @errors.each_pair do |name, nested|
    struct << indent(structure_exception(name, nested))
  end
  struct.join("\n")
end