Class: Sappho::Heatmiser::Proxy::SystemConfiguration
- Inherits:
-
Object
- Object
- Sappho::Heatmiser::Proxy::SystemConfiguration
- Includes:
- Singleton
- Defined in:
- lib/sappho-heatmiser-proxy/system_configuration.rb
Instance Attribute Summary collapse
-
#heatmiserHostname ⇒ Object
readonly
Returns the value of attribute heatmiserHostname.
-
#heatmiserPort ⇒ Object
readonly
Returns the value of attribute heatmiserPort.
-
#maxClients ⇒ Object
readonly
Returns the value of attribute maxClients.
-
#pinHi ⇒ Object
readonly
Returns the value of attribute pinHi.
-
#pinLo ⇒ Object
readonly
Returns the value of attribute pinLo.
-
#sampleDelay ⇒ Object
readonly
Returns the value of attribute sampleDelay.
Instance Method Summary collapse
-
#initialize ⇒ SystemConfiguration
constructor
A new instance of SystemConfiguration.
Constructor Details
#initialize ⇒ SystemConfiguration
Returns a new instance of SystemConfiguration.
19 20 21 22 23 24 25 26 27 28 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 19 def initialize data = YAML.load_file(File.(ARGV[0] || 'heatmiser-proxy.yml')) @heatmiserHostname = data['heatmiser.address'] @heatmiserPort = Integer data['heatmiser.port'] pin = Integer data['heatmiser.pin'] @pinLo = pin & 0xFF @pinHi = (pin >> 8) & 0xFF @sampleDelay = Integer data['heatmiser.sample.delay'] @maxClients = Integer data['clients.max'] end |
Instance Attribute Details
#heatmiserHostname ⇒ Object (readonly)
Returns the value of attribute heatmiserHostname.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def heatmiserHostname @heatmiserHostname end |
#heatmiserPort ⇒ Object (readonly)
Returns the value of attribute heatmiserPort.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def heatmiserPort @heatmiserPort end |
#maxClients ⇒ Object (readonly)
Returns the value of attribute maxClients.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def maxClients @maxClients end |
#pinHi ⇒ Object (readonly)
Returns the value of attribute pinHi.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def pinHi @pinHi end |
#pinLo ⇒ Object (readonly)
Returns the value of attribute pinLo.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def pinLo @pinLo end |
#sampleDelay ⇒ Object (readonly)
Returns the value of attribute sampleDelay.
17 18 19 |
# File 'lib/sappho-heatmiser-proxy/system_configuration.rb', line 17 def sampleDelay @sampleDelay end |