Exception: Crm::Errors::InvalidValues
- Inherits:
-
ClientError
- Object
- StandardError
- BaseError
- ClientError
- Crm::Errors::InvalidValues
- Defined in:
- lib/crm/errors.rb
Overview
InvalidValues is raised if the keys of a create or update request are recognized
but include incorrect values.
Instance Attribute Summary collapse
-
#validation_errors ⇒ Array<Hash{String => String}>
readonly
Returns the list of validation errors.
Instance Method Summary collapse
-
#initialize(message = nil, validation_errors = {}) ⇒ InvalidValues
constructor
A new instance of InvalidValues.
Constructor Details
#initialize(message = nil, validation_errors = {}) ⇒ InvalidValues
Returns a new instance of InvalidValues.
139 140 141 142 143 |
# File 'lib/crm/errors.rb', line 139 def initialize( = nil, validation_errors = {}) super("#{} #{validation_errors.map{ |h| h['message'] }.to_sentence}.") @validation_errors = validation_errors end |
Instance Attribute Details
#validation_errors ⇒ Array<Hash{String => String}> (readonly)
Returns the list of validation errors.
The items in the list are hashes consisting of a code (the name of the validation error,
i.e. one of the rails validation error codes),
an attribute name and an English translation (+message+).
You may use code to translate the message into other languages.
137 138 139 |
# File 'lib/crm/errors.rb', line 137 def validation_errors @validation_errors end |