Class: Inforouter::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/inforouter/configuration.rb

Overview

infoRouter gem configuration.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options = {}) ⇒ Configuration

Returns a new instance of Configuration.



13
14
15
# File 'lib/inforouter/configuration.rb', line 13

def initialize(options = {})
  @wsdl = options[:wsdl] || File.dirname(__FILE__) + '/../../resources/inforouter.wsdl'
end

Instance Attribute Details

#hostObject

infoRouter host.



7
8
9
# File 'lib/inforouter/configuration.rb', line 7

def host
  @host
end

#passwordObject

infoRouter password.



11
12
13
# File 'lib/inforouter/configuration.rb', line 11

def password
  @password
end

#usernameObject

infoRouter username.



9
10
11
# File 'lib/inforouter/configuration.rb', line 9

def username
  @username
end

#wsdlObject

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