Class: ActiveCampaign::Configuration
- Defined in:
- lib/active_campaign/configuration.rb
Instance Attribute Summary collapse
-
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
-
#api_key ⇒ Object
Returns the value of attribute api_key.
-
#api_output ⇒ Object
Returns the value of attribute api_output.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#log ⇒ Object
Returns the value of attribute log.
-
#log_level ⇒ Object
Returns the value of attribute log_level.
-
#logger ⇒ Object
Returns the value of attribute logger.
-
#mash ⇒ Object
Returns the value of attribute mash.
-
#user_agent ⇒ Object
Returns the value of attribute user_agent.
Instance Method Summary collapse
- #==(other) ⇒ Object (also: #eql?)
- #hash ⇒ Object
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #merge(other_config = {}) ⇒ Object
- #to_h ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
12 13 14 15 16 17 18 19 20 21 |
# File 'lib/active_campaign/configuration.rb', line 12 def initialize @api_key = nil @api_endpoint = API_ENDPOINT @api_output = API_OUTPUT @user_agent = USER_AGENT @log = false @logger = nil @log_level = :info @debug = false end |
Instance Attribute Details
#api_endpoint ⇒ Object
Returns the value of attribute api_endpoint.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def api_endpoint @api_endpoint end |
#api_key ⇒ Object
Returns the value of attribute api_key.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def api_key @api_key end |
#api_output ⇒ Object
Returns the value of attribute api_output.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def api_output @api_output end |
#debug ⇒ Object
Returns the value of attribute debug.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def debug @debug end |
#log ⇒ Object
Returns the value of attribute log.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def log @log end |
#log_level ⇒ Object
Returns the value of attribute log_level.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def log_level @log_level end |
#logger ⇒ Object
Returns the value of attribute logger.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def logger @logger end |
#mash ⇒ Object
Returns the value of attribute mash.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def mash @mash end |
#user_agent ⇒ Object
Returns the value of attribute user_agent.
9 10 11 |
# File 'lib/active_campaign/configuration.rb', line 9 def user_agent @user_agent end |
Instance Method Details
#==(other) ⇒ Object Also known as: eql?
43 44 45 46 47 48 49 |
# File 'lib/active_campaign/configuration.rb', line 43 def ==(other) other.is_a?(ActiveCampaign::Configuration) && all_api_info_equal && user_agent == other.user_agent && all_log_info_equal && debug == other.debug end |
#hash ⇒ Object
52 53 54 55 56 57 58 59 60 61 62 63 64 |
# File 'lib/active_campaign/configuration.rb', line 52 def hash [ api_key, api_endpoint, api_output, user_agent, log, logger, log_level, debug, ActiveCampaign::Configuration ].hash end |
#merge(other_config = {}) ⇒ Object
36 37 38 39 40 41 |
# File 'lib/active_campaign/configuration.rb', line 36 def merge(other_config = {}) other_config.to_h.each do |k, v| send("#{k}=", v) if respond_to?(k) end self end |
#to_h ⇒ Object
23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/active_campaign/configuration.rb', line 23 def to_h { api_key: api_key, api_endpoint: api_endpoint, api_output: api_output, user_agent: user_agent, log: log, logger: logger, log_level: log_level, debug: debug } end |