Exception: Ask::Tokens::InsufficientTokens
- Inherits:
-
StandardError
- Object
- StandardError
- Ask::Tokens::InsufficientTokens
- Defined in:
- lib/ask/tokens/insufficient_tokens.rb
Overview
Raised when a spend is attempted but the wallet has insufficient tokens. Also fired to the configured on_insufficient callback before raising.
Instance Attribute Summary collapse
-
#available ⇒ Object
readonly
Returns the value of attribute available.
-
#required ⇒ Object
readonly
Returns the value of attribute required.
Instance Method Summary collapse
-
#initialize(required:, available:) ⇒ InsufficientTokens
constructor
A new instance of InsufficientTokens.
Constructor Details
#initialize(required:, available:) ⇒ InsufficientTokens
Returns a new instance of InsufficientTokens.
11 12 13 14 15 |
# File 'lib/ask/tokens/insufficient_tokens.rb', line 11 def initialize(required:, available:) @required = required @available = available super("Insufficient tokens: need #{required}, have #{available}") end |
Instance Attribute Details
#available ⇒ Object (readonly)
Returns the value of attribute available.
9 10 11 |
# File 'lib/ask/tokens/insufficient_tokens.rb', line 9 def available @available end |
#required ⇒ Object (readonly)
Returns the value of attribute required.
9 10 11 |
# File 'lib/ask/tokens/insufficient_tokens.rb', line 9 def required @required end |