Class: ActiveCampaign::Configuration
- Inherits:
-
Object
- Object
- ActiveCampaign::Configuration
- Defined in:
- lib/active_campaign/configuration.rb
Overview
Class Configuration provides configuration of ActiveCampaign
Constant Summary collapse
- API_URL =
'https://account.api-us1.com/api/3'
- API_TOKEN =
'ACCOUNT_TOKEN'
Instance Attribute Summary collapse
-
#adapter ⇒ Object
Returns the value of attribute adapter.
-
#api_timeout ⇒ Object
Returns the value of attribute api_timeout.
-
#api_token ⇒ Object
Returns the value of attribute api_token.
-
#api_url ⇒ Object
Returns the value of attribute api_url.
-
#debug ⇒ Object
(also: #debug?)
Returns the value of attribute debug.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#request_middleware ⇒ Object
readonly
Returns the value of attribute request_middleware.
-
#response_middleware ⇒ Object
readonly
Returns the value of attribute response_middleware.
Instance Method Summary collapse
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
52 53 54 55 56 57 58 59 60 61 |
# File 'lib/active_campaign/configuration.rb', line 52 def initialize self.adapter = :net_http self.api_url = API_URL self.api_timeout = 5 self.api_token = API_TOKEN self.debug = false self.logger = Logger.new(STDOUT) @request_middleware = {} @response_middleware = {} end |
Instance Attribute Details
#adapter ⇒ Object
Returns the value of attribute adapter.
16 17 18 |
# File 'lib/active_campaign/configuration.rb', line 16 def adapter @adapter end |
#api_timeout ⇒ Object
Returns the value of attribute api_timeout.
34 35 36 |
# File 'lib/active_campaign/configuration.rb', line 34 def api_timeout @api_timeout end |
#api_token ⇒ Object
Returns the value of attribute api_token.
39 40 41 |
# File 'lib/active_campaign/configuration.rb', line 39 def api_token @api_token end |
#api_url ⇒ Object
Returns the value of attribute api_url.
29 30 31 |
# File 'lib/active_campaign/configuration.rb', line 29 def api_url @api_url end |
#debug ⇒ Object Also known as: debug?
Returns the value of attribute debug.
44 45 46 |
# File 'lib/active_campaign/configuration.rb', line 44 def debug @debug end |
#logger ⇒ Object
Returns the value of attribute logger.
50 51 52 |
# File 'lib/active_campaign/configuration.rb', line 50 def logger @logger end |
#request_middleware ⇒ Object (readonly)
Returns the value of attribute request_middleware.
20 21 22 |
# File 'lib/active_campaign/configuration.rb', line 20 def request_middleware @request_middleware end |
#response_middleware ⇒ Object (readonly)
Returns the value of attribute response_middleware.
24 25 26 |
# File 'lib/active_campaign/configuration.rb', line 24 def response_middleware @response_middleware end |
Instance Method Details
#to_h ⇒ Object
103 104 105 106 107 108 109 110 111 112 |
# File 'lib/active_campaign/configuration.rb', line 103 def to_h { adapter: adapter, api_url: api_url, api_timeout: api_timeout, api_token: api_token, request_middleware: request_middleware, response_middleware: response_middleware } end |