Class: NRB::BreweryControlSystem
- Inherits:
-
Object
- Object
- NRB::BreweryControlSystem
show all
- Defined in:
- lib/brewery_control_system.rb,
lib/brewery_control_system/api.rb,
lib/brewery_control_system/input.rb,
lib/brewery_control_system/output.rb,
lib/brewery_control_system/version.rb,
lib/brewery_control_system/middleware.rb,
lib/brewery_control_system/http_service.rb,
lib/brewery_control_system/temperature_probe.rb,
lib/brewery_control_system/http_service/user_agent.rb
Defined Under Namespace
Modules: Middleware
Classes: API, HTTPService, Input, TemperatureProbe
Constant Summary
collapse
- VERSION =
'0.0.6'.freeze
Instance Attribute Summary collapse
Class Method Summary
collapse
Instance Method Summary
collapse
Constructor Details
#initialize(api_class: API, base_url: nil, http_service_class: HTTPService, api_version: nil) ⇒ BreweryControlSystem
Returns a new instance of BreweryControlSystem.
43
44
45
46
47
48
|
# File 'lib/brewery_control_system.rb', line 43
def initialize(api_class: API, base_url: nil, http_service_class: HTTPService, api_version: nil)
self.api_class = api_class
@base_url = base_url; @base_url.freeze
self.http_service_class = http_service_class
self.api_version = api_version
end
|
Instance Attribute Details
#api_version ⇒ Object
13
14
15
|
# File 'lib/brewery_control_system.rb', line 13
def api_version
@api_version ||= firmware_version
end
|
Class Method Details
.version ⇒ Object
4
|
# File 'lib/brewery_control_system/version.rb', line 4
def self.version; VERSION; end
|
Instance Method Details
#device ⇒ Object
18
19
20
|
# File 'lib/brewery_control_system.rb', line 18
def device
api.device
end
|
#firmware_build ⇒ Object
33
34
35
|
# File 'lib/brewery_control_system.rb', line 33
def firmware_build
device.build
end
|
#firmware_version ⇒ Object
28
29
30
|
# File 'lib/brewery_control_system.rb', line 28
def firmware_version
device.version
end
|
#http_service(&block) ⇒ Object
38
39
40
|
# File 'lib/brewery_control_system.rb', line 38
def http_service &block
http_service_class.default_service url: base_url, &block
end
|
51
52
53
54
|
# File 'lib/brewery_control_system.rb', line 51
def inputs
[]
end
|
#name ⇒ Object
58
59
60
|
# File 'lib/brewery_control_system.rb', line 58
def name
device.name
end
|
#outputs ⇒ Object
63
64
65
|
# File 'lib/brewery_control_system.rb', line 63
def outputs
end
|
#processes ⇒ Object
68
69
70
71
72
73
74
|
# File 'lib/brewery_control_system.rb', line 68
def processes
[]
end
|
#setpoints ⇒ Object
77
78
79
|
# File 'lib/brewery_control_system.rb', line 77
def setpoints
api.setpoints
end
|
#temp_probes ⇒ Object
Also known as:
temperature_probes
82
83
84
|
# File 'lib/brewery_control_system.rb', line 82
def temp_probes
api.temperature_probes
end
|
#type ⇒ Object
88
89
90
|
# File 'lib/brewery_control_system.rb', line 88
def type
device.type
end
|