Class: UltraVault::Config
- Inherits:
-
Object
- Object
- UltraVault::Config
- Defined in:
- lib/ultravault/config.rb
Instance Attribute Summary collapse
-
#api_version ⇒ Object
Returns the value of attribute api_version.
-
#debug ⇒ Object
Returns the value of attribute debug.
-
#host ⇒ Object
Returns the value of attribute host.
-
#password ⇒ Object
Returns the value of attribute password.
-
#port ⇒ Object
Returns the value of attribute port.
-
#ssl ⇒ Object
Returns the value of attribute ssl.
-
#username ⇒ Object
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(params = {}) ⇒ Config
constructor
A new instance of Config.
- #set_debug(state) ⇒ Object
- #update(params) ⇒ Object
Constructor Details
#initialize(params = {}) ⇒ Config
Returns a new instance of Config.
21 22 23 24 |
# File 'lib/ultravault/config.rb', line 21 def initialize(params={}) params = defaults.merge(params) update(params) end |
Instance Attribute Details
#api_version ⇒ Object
Returns the value of attribute api_version.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def api_version @api_version end |
#debug ⇒ Object
Returns the value of attribute debug.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def debug @debug end |
#host ⇒ Object
Returns the value of attribute host.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def host @host end |
#password ⇒ Object
Returns the value of attribute password.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def password @password end |
#port ⇒ Object
Returns the value of attribute port.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def port @port end |
#ssl ⇒ Object
Returns the value of attribute ssl.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def ssl @ssl end |
#username ⇒ Object
Returns the value of attribute username.
17 18 19 |
# File 'lib/ultravault/config.rb', line 17 def username @username end |
Instance Method Details
#set_debug(state) ⇒ Object
37 38 39 40 41 42 43 |
# File 'lib/ultravault/config.rb', line 37 def set_debug(state) Savon.configure do |config| config.log = state HTTPI.log = state end @debug = state end |
#update(params) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/ultravault/config.rb', line 26 def update(params) params.each do |k,v| instance_variable_set("@#{k}", v) end set_debug(@debug) end |