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.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #endpoint ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 |
# File 'lib/klarna/configuration.rb', line 5 def initialize @country = :us @environment = :production @endpoints = Hash.new( test: "https://api.playground.klarna.com", production: "https://api.klarna.com" ) # US has a different host @endpoints[:us] = { test: "https://api-na.playground.klarna.com", production: "https://api-na.klarna.com" } @version = :v1 @debugger = false #$stdout end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def api_key @api_key end |
#api_secret ⇒ Object
Returns the value of attribute api_secret.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def api_secret @api_secret end |
#country ⇒ Object
Returns the value of attribute country.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def country @country end |
#debugger ⇒ Object
Returns the value of attribute debugger.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def debugger @debugger end |
#environment ⇒ Object
Returns the value of attribute environment.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def environment @environment end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def user_agent @user_agent end |
#version ⇒ Object
Returns the value of attribute version.
3 4 5 |
# File 'lib/klarna/configuration.rb', line 3 def version @version end |
Instance Method Details
#endpoint ⇒ Object
21 22 23 |
# File 'lib/klarna/configuration.rb', line 21 def endpoint @endpoints[@country.to_sym][@environment.to_sym] end |