Class: Inforouter::Configuration
- Inherits:
-
Object
- Object
- Inforouter::Configuration
- Defined in:
- lib/inforouter/configuration.rb
Overview
infoRouter gem configuration.
Instance Attribute Summary collapse
-
#host ⇒ Object
infoRouter host.
-
#password ⇒ Object
infoRouter password.
-
#username ⇒ Object
infoRouter username.
-
#wsdl ⇒ Object
infoRouter WSDL.
Instance Method Summary collapse
-
#check! ⇒ Object
Check the configuration.
-
#initialize(options = {}) ⇒ Configuration
constructor
A new instance of Configuration.
Constructor Details
#initialize(options = {}) ⇒ Configuration
Returns a new instance of Configuration.
13 14 15 |
# File 'lib/inforouter/configuration.rb', line 13 def initialize( = {}) @wsdl = [:wsdl] || File.dirname(__FILE__) + '/../../resources/inforouter.wsdl' end |
Instance Attribute Details
#host ⇒ Object
infoRouter host.
7 8 9 |
# File 'lib/inforouter/configuration.rb', line 7 def host @host end |
#password ⇒ Object
infoRouter password.
11 12 13 |
# File 'lib/inforouter/configuration.rb', line 11 def password @password end |
#username ⇒ Object
infoRouter username.
9 10 11 |
# File 'lib/inforouter/configuration.rb', line 9 def username @username end |
#wsdl ⇒ Object
infoRouter WSDL.
5 6 7 |
# File 'lib/inforouter/configuration.rb', line 5 def wsdl @wsdl end |
Instance Method Details
#check! ⇒ Object
Check the configuration.
Will raise a Inforouter::Errors::MissingConfigOption if any of the host or the username are missing.
21 22 23 24 |
# File 'lib/inforouter/configuration.rb', line 21 def check! fail Inforouter::Errors::MissingConfigOption.new('host') unless host && host.strip.length > 0 fail Inforouter::Errors::MissingConfigOption.new('username') unless username && username.strip.length > 0 end |