Module: OBIX::Configuration
- Defined in:
- lib/obix/configuration.rb
Class Method Summary collapse
- .configure(&block) ⇒ Object
- .definitions ⇒ Object
- .definitions=(hash) ⇒ Object
-
.host ⇒ Object
The host of the server.
-
.host=(host) ⇒ Object
The host of the server.
-
.password ⇒ Object
The password to use when communicating with the server.
-
.password=(password) ⇒ Object
The password to use when communicating with the server.
-
.scheme ⇒ Object
The scheme of the server.
-
.scheme=(scheme) ⇒ Object
The scheme of the server.
-
.timeout ⇒ Object
Timeout.
-
.timeout=(seconds) ⇒ Object
Timeout.
-
.username ⇒ Object
The username to use when communicating with the server.
-
.username=(username) ⇒ Object
The username to use when communicating with the server.
Class Method Details
.configure(&block) ⇒ Object
5 6 7 |
# File 'lib/obix/configuration.rb', line 5 def self.configure &block instance_eval &block end |
.definitions ⇒ Object
9 10 11 |
# File 'lib/obix/configuration.rb', line 9 def self.definitions @definitions ||= {} end |
.definitions=(hash) ⇒ Object
13 14 15 |
# File 'lib/obix/configuration.rb', line 13 def self.definitions= hash @definitions = hash end |
.host ⇒ Object
The host of the server.
61 62 63 |
# File 'lib/obix/configuration.rb', line 61 def self.host definitions[:host] end |
.host=(host) ⇒ Object
The host of the server.
host - A String describing the host.
56 57 58 |
# File 'lib/obix/configuration.rb', line 56 def self.host= host definitions[:host] = host end |
.password ⇒ Object
The password to use when communicating with the server.
37 38 39 |
# File 'lib/obix/configuration.rb', line 37 def self.password definitions[:password] end |
.password=(password) ⇒ Object
The password to use when communicating with the server.
password - A String describing the password.
32 33 34 |
# File 'lib/obix/configuration.rb', line 32 def self.password= password definitions[:password] = password end |
.scheme ⇒ Object
The scheme of the server.
49 50 51 |
# File 'lib/obix/configuration.rb', line 49 def self.scheme definitions[:scheme] || "http" end |
.scheme=(scheme) ⇒ Object
The scheme of the server.
host - A String describing the host.
44 45 46 |
# File 'lib/obix/configuration.rb', line 44 def self.scheme= scheme definitions[:scheme] = scheme end |
.timeout ⇒ Object
Timeout.
73 74 75 |
# File 'lib/obix/configuration.rb', line 73 def self.timeout definitions[:timeout] || 30 end |
.timeout=(seconds) ⇒ Object
Timeout.
seconds - An Integer describing timeout in seconds.
68 69 70 |
# File 'lib/obix/configuration.rb', line 68 def self.timeout= seconds definitions[:timeout] = seconds end |
.username ⇒ Object
The username to use when communicating with the server.
25 26 27 |
# File 'lib/obix/configuration.rb', line 25 def self.username definitions[:username] end |
.username=(username) ⇒ Object
The username to use when communicating with the server.
username - A String describing the username.
20 21 22 |
# File 'lib/obix/configuration.rb', line 20 def self.username= username definitions[:username] = username end |