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.
Instance Method Summary collapse
-
#check! ⇒ Object
Check the configuration.
Instance Attribute Details
#host ⇒ Object
Inforouter host.
5 6 7 |
# File 'lib/inforouter/configuration.rb', line 5 def host @host end |
#password ⇒ Object
Inforouter password.
9 10 11 |
# File 'lib/inforouter/configuration.rb', line 9 def password @password end |
#username ⇒ Object
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 |