Module: Infusionsoft::Configuration
- Included in:
- Infusionsoft
- Defined in:
- lib/infusionsoft/configuration.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
end.
Instance Method Details
#api_logger ⇒ Object
43 44 45 |
# File 'lib/infusionsoft/configuration.rb', line 43 def api_logger @api_logger || Infusionsoft::APILogger.new end |
#configure {|_self| ... } ⇒ Object
Convenience method to allow configuration options to be set in a block
23 24 25 |
# File 'lib/infusionsoft/configuration.rb', line 23 def configure yield self end |
#options ⇒ Object
Create a hash of options and their values
28 29 30 31 32 |
# File 'lib/infusionsoft/configuration.rb', line 28 def = {} VALID_OPTION_KEYS.each{|k| [k] = send(k)} end |
#user_agent ⇒ Object
end
39 40 41 |
# File 'lib/infusionsoft/configuration.rb', line 39 def user_agent @user_agent ||= "Infusionsoft-#{VERSION} (RubyGem)" end |