Exception: SEPA::UnknownCountryError
- Defined in:
- lib/sepa_rator/error.rb
Overview
Raised when ‘Message.new(country:)` is called with a symbol that isn’t a recognized SEPA country code. Catches typos like ‘:fre` instead of `:fr`, which would otherwise silently fall back to the generic EPC profile.
Instance Attribute Summary collapse
-
#country ⇒ Object
readonly
Returns the value of attribute country.
-
#known_countries ⇒ Object
readonly
Returns the value of attribute known_countries.
Instance Method Summary collapse
-
#initialize(country:, known_countries:) ⇒ UnknownCountryError
constructor
A new instance of UnknownCountryError.
Constructor Details
#initialize(country:, known_countries:) ⇒ UnknownCountryError
Returns a new instance of UnknownCountryError.
13 14 15 16 17 18 |
# File 'lib/sepa_rator/error.rb', line 13 def initialize(country:, known_countries:) @country = country @known_countries = known_countries super("Unknown country #{country.inspect}. Known SEPA countries: " \ "#{known_countries.sort.inspect}. Pass `country: nil` to use the generic SEPA profile.") end |
Instance Attribute Details
#country ⇒ Object (readonly)
Returns the value of attribute country.
11 12 13 |
# File 'lib/sepa_rator/error.rb', line 11 def country @country end |
#known_countries ⇒ Object (readonly)
Returns the value of attribute known_countries.
11 12 13 |
# File 'lib/sepa_rator/error.rb', line 11 def known_countries @known_countries end |