Class: Adtraction::Api::Configuration
- Inherits:
-
Object
- Object
- Adtraction::Api::Configuration
- Defined in:
- lib/adtraction/api/configuration.rb
Instance Attribute Summary collapse
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#faraday ⇒ Object
Returns the value of attribute faraday.
-
#host ⇒ Object
Returns the value of attribute host.
Instance Method Summary collapse
-
#initialize(host: "api.adtraction.com", api_version: 1, api_key: nil) ⇒ Configuration
constructor
A new instance of Configuration.
- #verbose_faraday? ⇒ Boolean
Constructor Details
#initialize(host: "api.adtraction.com", api_version: 1, api_key: nil) ⇒ Configuration
Returns a new instance of Configuration.
6 7 8 9 10 11 12 13 14 15 16 |
# File 'lib/adtraction/api/configuration.rb', line 6 def initialize(host: "api.adtraction.com", api_version: 1, api_key: nil) self.host = host self.api_version = api_version self.api_key = api_key self.faraday = { adapter: :net_http, user_agent: "Adtraction Ruby Client #{::Adtraction::Api::VERSION}", verbose: false } end |
Instance Attribute Details
#api_key ⇒ Object
Returns the value of attribute api_key.
4 5 6 |
# File 'lib/adtraction/api/configuration.rb', line 4 def api_key @api_key end |
#api_version ⇒ Object
Returns the value of attribute api_version.
4 5 6 |
# File 'lib/adtraction/api/configuration.rb', line 4 def api_version @api_version end |
#faraday ⇒ Object
Returns the value of attribute faraday.
4 5 6 |
# File 'lib/adtraction/api/configuration.rb', line 4 def faraday @faraday end |
#host ⇒ Object
Returns the value of attribute host.
4 5 6 |
# File 'lib/adtraction/api/configuration.rb', line 4 def host @host end |
Instance Method Details
#verbose_faraday? ⇒ Boolean
18 19 20 |
# File 'lib/adtraction/api/configuration.rb', line 18 def verbose_faraday? self.faraday.fetch(:verbose, false) end |