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

Instance Attribute Details

#hostObject

Inforouter host.



5
6
7
# File 'lib/inforouter/configuration.rb', line 5

def host
  @host
end

#passwordObject

Inforouter password.



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

def password
  @password
end

#usernameObject

Inforouter username.



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

def username
  @username
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.



15
16
17
18
# File 'lib/inforouter/configuration.rb', line 15

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