Class: LS4::WeightService
Instance Method Summary
collapse
Methods inherited from Service
init
#ebus_bind!, #ebus_connect, extended
#ebus_all_slots, #ebus_disconnect!
#connect, #ebus_all_slots, #ebus_call_log, #ebus_call_slots, #ebus_signal_error, #ebus_signal_log, #ebus_signal_slots
#call_slot, #signal_slot
Constructor Details
Returns a new instance of WeightService.
33
34
35
|
# File 'lib/ls4/service/weight.rb', line 33
def initialize
@winfo = WeightInfo.new
end
|
Instance Method Details
#get_registered_rsids ⇒ Object
51
52
53
|
# File 'lib/ls4/service/weight.rb', line 51
def get_registered_rsids
@winfo.get_registered_rsids
end
|
#get_weight(rsid) ⇒ Object
47
48
49
|
# File 'lib/ls4/service/weight.rb', line 47
def get_weight(rsid)
@winfo.get_weight(rsid)
end
|
#on_change ⇒ Object
55
56
57
|
# File 'lib/ls4/service/weight.rb', line 55
def on_change
BalanceBus.update_weight
end
|
#run ⇒ Object
37
38
39
40
41
|
# File 'lib/ls4/service/weight.rb', line 37
def run
@weight_path = ConfigBus.get_weight_path
@winfo.open(@weight_path) if @weight_path
on_change
end
|
#shutdown ⇒ Object
43
44
45
|
# File 'lib/ls4/service/weight.rb', line 43
def shutdown
@winfo.close if @weight_path
end
|