Exception: Crm::Errors::ItemStatePreconditionFailed
- Inherits:
-
ClientError
- Object
- StandardError
- BaseError
- ClientError
- Crm::Errors::ItemStatePreconditionFailed
- Defined in:
- lib/crm/errors.rb
Overview
ItemStatePreconditionFailed is raised if one or more preconditions for the attempted action were not satisfied.
Instance Attribute Summary collapse
-
#unmet_preconditions ⇒ Array<Hash{String => String}>
readonly
Returns the unmet preconditions.
Instance Method Summary collapse
-
#initialize(message = nil, unmet_preconditions) ⇒ ItemStatePreconditionFailed
constructor
A new instance of ItemStatePreconditionFailed.
Constructor Details
#initialize(message = nil, unmet_preconditions) ⇒ ItemStatePreconditionFailed
Returns a new instance of ItemStatePreconditionFailed.
78 79 80 81 82 83 84 |
# File 'lib/crm/errors.rb', line 78 def initialize( = nil, unmet_preconditions) = unmet_preconditions.map{ |p| p['message'] } = ([] + ).join(' ') super() @unmet_preconditions = unmet_preconditions end |
Instance Attribute Details
#unmet_preconditions ⇒ Array<Hash{String => String}> (readonly)
Returns the unmet preconditions. The items in the list are hashes consisting of a code (the name of the precondition), and an English translation (message).
76 77 78 |
# File 'lib/crm/errors.rb', line 76 def unmet_preconditions @unmet_preconditions end |