Class: Klarna::Configuration
- Inherits:
-
Object
- Object
- Klarna::Configuration
- Defined in:
- lib/klarna/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_secret ⇒ Object
Returns the value of attribute api_secret.
-
#country ⇒ Object
Returns the value of attribute country.
-
#debugger ⇒ Object
Returns the value of attribute debugger.
-
#environment ⇒ Object
Returns the value of attribute environment.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
-
#zone ⇒ Object
Returns the value of attribute zone.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/klarna/configuration.rb', line 7 def initialize @country = :us @zone = :us @environment = :production @debugger = false @endpoints = { europe: { test: 'https://api.playground.klarna.com', production: 'https://api.klarna.com' }, oceania: { test: 'https://api-oc.playground.klarna.com', production: 'https://api-oc.klarna.com' }, us: { test: 'https://api-na.playground.klarna.com', production: 'https://api-na.klarna.com' } } end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def api_secret @api_secret end |
#country ⇒ Object
Returns the value of attribute country.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def country @country end |
#debugger ⇒ Object
Returns the value of attribute debugger.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def debugger @debugger end |
#environment ⇒ Object
Returns the value of attribute environment.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def environment @environment end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def user_agent @user_agent end |
#zone ⇒ Object
Returns the value of attribute zone.
5 6 7 |
# File 'lib/klarna/configuration.rb', line 5 def zone @zone end |
Instance Method Details
#endpoint ⇒ Object
29 30 31 |
# File 'lib/klarna/configuration.rb', line 29 def endpoint endpoints[zone.to_sym][environment.to_sym] end |