Exception: Anakin::InsufficientCreditsError
- Defined in:
- lib/anakin/errors.rb
Overview
402 — out of credits. balance / required carry the failure context.
Instance Attribute Summary collapse
-
#balance ⇒ Object
readonly
Returns the value of attribute balance.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
Attributes inherited from Error
Instance Method Summary collapse
-
#initialize(message, status: 402, code: nil, balance: 0, required: 0) ⇒ InsufficientCreditsError
constructor
A new instance of InsufficientCreditsError.
Constructor Details
#initialize(message, status: 402, code: nil, balance: 0, required: 0) ⇒ InsufficientCreditsError
Returns a new instance of InsufficientCreditsError.
21 22 23 24 25 |
# File 'lib/anakin/errors.rb', line 21 def initialize(, status: 402, code: nil, balance: 0, required: 0) super(, status: status, code: code) @balance = balance @required = required end |
Instance Attribute Details
#balance ⇒ Object (readonly)
Returns the value of attribute balance.
19 20 21 |
# File 'lib/anakin/errors.rb', line 19 def balance @balance end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
19 20 21 |
# File 'lib/anakin/errors.rb', line 19 def required @required end |