Exception: Timeprice::UnsupportedCurrency

Inherits:
Error
  • Object
show all
Defined in:
lib/timeprice/errors.rb

Overview

Raised when a currency code is not in Supported::CURRENCIES.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(currency) ⇒ UnsupportedCurrency

Returns a new instance of UnsupportedCurrency.



24
25
26
27
# File 'lib/timeprice/errors.rb', line 24

def initialize(currency)
  @currency = currency
  super("Unsupported currency: #{currency.inspect} (supported: #{Supported::CURRENCIES.join(", ")})")
end

Instance Attribute Details

#currencyObject (readonly)

Returns the value of attribute currency.



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

def currency
  @currency
end