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