Exception: Timeprice::UnsupportedCountry

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

Overview

Raised when a country code is not in Supported::COUNTRIES.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(country) ⇒ UnsupportedCountry

Returns a new instance of UnsupportedCountry.



14
15
16
17
# File 'lib/timeprice/errors.rb', line 14

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

Instance Attribute Details

#countryObject (readonly)

Returns the value of attribute country.



12
13
14
# File 'lib/timeprice/errors.rb', line 12

def country
  @country
end