Exception: ScreenshotAPI::InsufficientCreditsError

Inherits:
APIError
  • Object
show all
Defined in:
lib/screenshotapi/errors.rb

Instance Attribute Summary collapse

Attributes inherited from APIError

#code, #status

Instance Method Summary collapse

Constructor Details

#initialize(message, balance: 0) ⇒ InsufficientCreditsError

Returns a new instance of InsufficientCreditsError.



21
22
23
24
# File 'lib/screenshotapi/errors.rb', line 21

def initialize(message, balance: 0)
  super(message, status: 402, code: "insufficient_credits")
  @balance = balance
end

Instance Attribute Details

#balanceObject (readonly)

Returns the value of attribute balance.



19
20
21
# File 'lib/screenshotapi/errors.rb', line 19

def balance
  @balance
end