Class: Gestpay::Configuration
- Inherits:
-
Object
- Object
- Gestpay::Configuration
- Defined in:
- lib/gestpay/configuration.rb
Constant Summary collapse
- CURRENCY_MAPPING =
{ 'EUR' => '242', 'ITL' => '18', 'BRL' => '234', 'USD' => '1', 'JPY' => '71', 'HKD' => '103' }
- LANGUAGE_MAPPING =
{ 'ITA' => '1' }
Instance Attribute Summary collapse
-
#account ⇒ Object
Returns the value of attribute account.
-
#currency ⇒ Object
Returns the value of attribute currency.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#language ⇒ Object
Returns the value of attribute language.
Instance Method Summary collapse
- #currency_code ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #language_code ⇒ Object
Constructor Details
#initialize ⇒ Configuration
18 19 20 21 22 23 |
# File 'lib/gestpay/configuration.rb', line 18 def initialize @environment = ENV['GESTPAY_ENVIRONMENT'] || :test @account = ENV['GESTPAY_ACCOUNT'] @currency = 'EUR' @language = 'ITA' end |
Instance Attribute Details
#account ⇒ Object
Returns the value of attribute account.
17 18 19 |
# File 'lib/gestpay/configuration.rb', line 17 def account @account end |
#currency ⇒ Object
Returns the value of attribute currency.
17 18 19 |
# File 'lib/gestpay/configuration.rb', line 17 def currency @currency end |
#environment ⇒ Object
Returns the value of attribute environment.
17 18 19 |
# File 'lib/gestpay/configuration.rb', line 17 def environment @environment end |
#language ⇒ Object
Returns the value of attribute language.
17 18 19 |
# File 'lib/gestpay/configuration.rb', line 17 def language @language end |
Instance Method Details
#currency_code ⇒ Object
25 26 27 |
# File 'lib/gestpay/configuration.rb', line 25 def currency_code CURRENCY_MAPPING[@currency] end |
#language_code ⇒ Object
29 30 31 |
# File 'lib/gestpay/configuration.rb', line 29 def language_code LANGUAGE_MAPPING[@language] end |