Module: EventBus::DeclarerBase::Methods

Included in:
BusMixin
Defined in:
lib/ls4/lib/ebus.rb

Instance Method Summary collapse

Instance Method Details

#connect(slot, method) ⇒ Object



162
163
164
165
# File 'lib/ls4/lib/ebus.rb', line 162

def connect(slot, method)
	slot = slot.to_sym
	__send__("connect_#{slot}", method)
end

#ebus_all_slotsObject



176
177
178
179
180
181
182
183
184
185
186
# File 'lib/ls4/lib/ebus.rb', line 176

def ebus_all_slots
	slots = []
	(class<<self;self;end).module_eval do
		constants.each {|const|
			if const.to_s =~ /^EBUS_SLOT_.*/
				slots << const_get(const)
			end
		}
	end
	slots
end

#ebus_call_log(method, args, &block) ⇒ Object



167
168
# File 'lib/ls4/lib/ebus.rb', line 167

def ebus_call_log(method, args, &block)
end

#ebus_call_slotsObject



188
189
190
191
192
# File 'lib/ls4/lib/ebus.rb', line 188

def ebus_call_slots
	ebus_all_slots.select {|s|
		s.is_a?(CallSlot)
	}
end

#ebus_signal_error(err) ⇒ Object



173
174
# File 'lib/ls4/lib/ebus.rb', line 173

def ebus_signal_error(err)
end

#ebus_signal_log(methods, args, &block) ⇒ Object



170
171
# File 'lib/ls4/lib/ebus.rb', line 170

def ebus_signal_log(methods, args, &block)
end

#ebus_signal_slotsObject



194
195
196
197
198
# File 'lib/ls4/lib/ebus.rb', line 194

def ebus_signal_slots
	ebus_all_slots.select {|s|
		s.is_a?(SignalSlot)
	}
end