Class: ActiveCampaignRb::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/active_campaign_rb/config.rb

Overview

Config object

Instance Attribute Summary collapse

Instance Method Summary collapse

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

#adapterObject

Returns the value of attribute adapter.



8
9
10
# File 'lib/active_campaign_rb/config.rb', line 8

def adapter
  @adapter
end

#api_endpointObject

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_keyObject

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

#debugObject 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_middlewareObject

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_middlewareObject

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