class NRB::BreweryControlSystem::API
Attributes
api_version[RW]
base_url[RW]
bcs[RW]
Public Class Methods
new(api_version: '3.7.0', base_url: nil, bcs: nil)
click to toggle source
Processes
name string running boolean paused boolean run_on_startup boolean current_state state name string state integer
# File lib/brewery_control_system/api.rb, line 65 def initialize(api_version: '3.7.0', base_url: nil, bcs: nil) self.base_url = base_url self.bcs = bcs self.api_version = api_version require_endpoints end
Public Instance Methods
device()
click to toggle source
name string type string version string build string
3.x
/bcs_sys.cfg
4.x
/device
# File lib/brewery_control_system/api.rb, line 17 def device @device_response ||= http_service do |b| b.response DeviceEndpoint end.get(DeviceEndpoint.endpoint).body Device.new *@device_response end
http_service() { |service| ... }
click to toggle source
# File lib/brewery_control_system/api.rb, line 25 def http_service service = bcs.http_service do |b| b.response VersionCheck, api_version end yield service if block_given? service end
temperature_probes()
click to toggle source
Temperature Probes
name string temp integer setpoint integer resistance integer enabled boolean coefficients array
# File lib/brewery_control_system/api.rb, line 41 def temperature_probes TemperatureProbesEndpoint.fetch api: self end
Private Instance Methods
require_endpoints()
click to toggle source
# File lib/brewery_control_system/api.rb, line 77 def require_endpoints %w( endpoint device_endpoint setpoints temps temperature_probes_endpoint ultemp ).each do |f| begin require "brewery_control_system/api/#{api_version}/#{f}" rescue LoadError => e warn "API v#{api_version} may not function: #{e}" end end end