Exception: Relaxo::Model::ValidationErrors
- Inherits:
-
StandardError
- Object
- StandardError
- Relaxo::Model::ValidationErrors
- Defined in:
- lib/relaxo/model/document.rb
Instance Attribute Summary collapse
-
#errors ⇒ Object
readonly
Returns the value of attribute errors.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize(errors) ⇒ ValidationErrors
constructor
A new instance of ValidationErrors.
Constructor Details
#initialize(errors) ⇒ ValidationErrors
Returns a new instance of ValidationErrors.
30 31 32 33 34 |
# File 'lib/relaxo/model/document.rb', line 30 def initialize(errors) super "Model validation errors occurred: #{self.class.(errors)}" @errors = errors end |
Instance Attribute Details
#errors ⇒ Object (readonly)
Returns the value of attribute errors.
36 37 38 |
# File 'lib/relaxo/model/document.rb', line 36 def errors @errors end |
Class Method Details
.message_for_errors(errors) ⇒ Object
26 27 28 |
# File 'lib/relaxo/model/document.rb', line 26 def self.(errors) errors.map{|error| "#{error.key} (#{error.exception.})"}.join(', ') end |