Class: ActiveCampaignRb::Config
- Inherits:
-
Object
- Object
- ActiveCampaignRb::Config
- Defined in:
- lib/active_campaign_rb/config.rb
Overview
Config object
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#debug ⇒ Object
(also: #debug?)
Returns the value of attribute debug.
-
#request_middleware ⇒ Object
Returns the value of attribute request_middleware.
-
#response_middleware ⇒ Object
Returns the value of attribute response_middleware.
Instance Method Summary collapse
-
#initialize(opts = {}) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(opts = {}) ⇒ Config
Returns a new instance of Config.
11 12 13 14 15 16 17 18 |
# File 'lib/active_campaign_rb/config.rb', line 11 def initialize(opts = {}) @api_endpoint = opts[:api_endpoint] @api_key = opts[:api_key] @debug = opts.fetch(:api_key, false) @adapter = opts.fetch(:adapter, :net_http) @request_middleware = opts.fetch(:request_middleware, {}) @response_middleware = opts.fetch(:response_middleware, {}) end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def adapter @adapter end |
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def api_endpoint @api_endpoint end |
#api_key ⇒ Object
Returns the value of attribute api_key.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def api_key @api_key end |
#debug ⇒ Object Also known as: debug?
Returns the value of attribute debug.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def debug @debug end |
#request_middleware ⇒ Object
Returns the value of attribute request_middleware.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def request_middleware @request_middleware end |
#response_middleware ⇒ Object
Returns the value of attribute response_middleware.
8 9 10 |
# File 'lib/active_campaign_rb/config.rb', line 8 def response_middleware @response_middleware end |