Module: ActiveCampaign::Config
- Included in:
- ActiveCampaign
- Defined in:
- lib/active-campaign-simple/config.rb
Constant Summary collapse
- VALID_OPTION_KEYS =
The list of available options
[ :api_url, :api_key, :api_logger, :user_agent # allows you to change the User-Agent of the request headers ].freeze
Instance Method Summary collapse
- #api_logger ⇒ Object
-
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block.
-
#options ⇒ Object
Create a hash of options and their values.
- #user_agent ⇒ Object
Instance Method Details
#api_logger ⇒ Object
33 34 35 |
# File 'lib/active-campaign-simple/config.rb', line 33 def api_logger @api_logger || ActiveCampaign::Logger.new end |
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
18 19 20 |
# File 'lib/active-campaign-simple/config.rb', line 18 def configure yield self end |
#options ⇒ Object
Create a hash of options and their values
23 24 25 26 27 |
# File 'lib/active-campaign-simple/config.rb', line 23 def = {} VALID_OPTION_KEYS.each{|k| [k] = send(k)} end |
#user_agent ⇒ Object
29 30 31 |
# File 'lib/active-campaign-simple/config.rb', line 29 def user_agent @user_agent ||= "active-campaign-simple-#{VERSION} (RubyGem)" end |