Class: Fountain::Papi::Config
- Inherits:
-
Object
- Object
- Fountain::Papi::Config
- Defined in:
- lib/fountain/papi/config.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#base_domain ⇒ Object
Returns the value of attribute base_domain.
-
#partner_id ⇒ Object
Returns the value of attribute partner_id.
-
#sandbox ⇒ Object
Returns the value of attribute sandbox.
-
#version ⇒ Object
Returns the value of attribute version.
Instance Method Summary collapse
- #base_uri(override_partner_id: nil) ⇒ Object
- #headers ⇒ Object
-
#initialize ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize ⇒ Config
Returns a new instance of Config.
8 9 10 11 12 13 14 |
# File 'lib/fountain/papi/config.rb', line 8 def initialize @api_key = nil # Partner API Key @partner_id = nil # Parter Identifier @sandbox = true # Default to sandbox @version = 1 # API version @base_domain = "https://partners-sandbox.fountain.com" # Default to sandbox base domain end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
6 7 8 |
# File 'lib/fountain/papi/config.rb', line 6 def api_key @api_key end |
#base_domain ⇒ Object
Returns the value of attribute base_domain.
6 7 8 |
# File 'lib/fountain/papi/config.rb', line 6 def base_domain @base_domain end |
#partner_id ⇒ Object
Returns the value of attribute partner_id.
6 7 8 |
# File 'lib/fountain/papi/config.rb', line 6 def partner_id @partner_id end |
#sandbox ⇒ Object
Returns the value of attribute sandbox.
6 7 8 |
# File 'lib/fountain/papi/config.rb', line 6 def sandbox @sandbox end |
#version ⇒ Object
Returns the value of attribute version.
6 7 8 |
# File 'lib/fountain/papi/config.rb', line 6 def version @version end |
Instance Method Details
#base_uri(override_partner_id: nil) ⇒ Object
16 17 18 |
# File 'lib/fountain/papi/config.rb', line 16 def base_uri(override_partner_id: nil) "#{base_domain}/v#{version}/partners/#{override_partner_id || partner_id}" end |
#headers ⇒ Object
20 21 22 23 24 25 |
# File 'lib/fountain/papi/config.rb', line 20 def headers { "Content-Type" => "application/json", "X-ACCESS-TOKEN" => api_key } end |