Class: Responsys::Configuration
- Inherits:
-
Object
- Object
- Responsys::Configuration
- Defined in:
- lib/responsys/configuration.rb
Instance Attribute Summary collapse
-
#settings ⇒ Object
Returns the value of attribute settings.
Instance Method Summary collapse
- #api_credentials ⇒ Object
- #debug? ⇒ Boolean
- #enabled? ⇒ Boolean
-
#initialize ⇒ Configuration
constructor
A new instance of Configuration.
- #savon_settings ⇒ Object
- #session_settings ⇒ Object
Constructor Details
#initialize ⇒ Configuration
Returns a new instance of Configuration.
5 6 7 |
# File 'lib/responsys/configuration.rb', line 5 def initialize @settings = {} end |
Instance Attribute Details
#settings ⇒ Object
Returns the value of attribute settings.
3 4 5 |
# File 'lib/responsys/configuration.rb', line 3 def settings @settings end |
Instance Method Details
#api_credentials ⇒ Object
22 23 24 25 26 27 |
# File 'lib/responsys/configuration.rb', line 22 def api_credentials { username: @settings[:username], password: @settings[:password] } end |
#debug? ⇒ Boolean
33 34 35 |
# File 'lib/responsys/configuration.rb', line 33 def debug? !!(@settings[:debug]) end |
#enabled? ⇒ Boolean
37 38 39 |
# File 'lib/responsys/configuration.rb', line 37 def enabled? !!(@settings[:enabled]) end |
#savon_settings ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 |
# File 'lib/responsys/configuration.rb', line 9 def savon_settings settings_hash = if @settings[:wsdl].present? { wsdl: @settings[:wsdl] } else { endpoint: @settings[:endpoint], namespace: @settings[:namespace] } end @settings[:savon_settings].merge(settings_hash) end |
#session_settings ⇒ Object
29 30 31 |
# File 'lib/responsys/configuration.rb', line 29 def session_settings @settings[:sessions] end |