Class: LS4::WeightService

Inherits:
Service show all
Defined in:
lib/ls4/service/weight.rb

Direct Known Subclasses

WeightManagerService, WeightMemberService

Instance Method Summary collapse

Methods inherited from Service

init

Methods included from EventBus::SingletonMixin

#ebus_bind!, #ebus_connect, extended

Methods included from EventBus::BusMixin

#ebus_all_slots, #ebus_disconnect!

Methods included from EventBus::DeclarerBase::Methods

#connect, #ebus_all_slots, #ebus_call_log, #ebus_call_slots, #ebus_signal_error, #ebus_signal_log, #ebus_signal_slots

Methods included from EventBus::DeclarerBase

#call_slot, #signal_slot

Constructor Details

#initializeWeightService

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_rsidsObject



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_changeObject



55
56
57
# File 'lib/ls4/service/weight.rb', line 55

def on_change
	BalanceBus.update_weight
end

#runObject



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

#shutdownObject



43
44
45
# File 'lib/ls4/service/weight.rb', line 43

def shutdown
	@winfo.close if @weight_path
end