Module: EventBus::DeclarerBase::Methods
- Included in:
- BusMixin
- Defined in:
- lib/ls4/lib/ebus.rb
Instance Method Summary collapse
- #connect(slot, method) ⇒ Object
- #ebus_all_slots ⇒ Object
- #ebus_call_log(method, args, &block) ⇒ Object
- #ebus_call_slots ⇒ Object
- #ebus_signal_error(err) ⇒ Object
- #ebus_signal_log(methods, args, &block) ⇒ Object
- #ebus_signal_slots ⇒ Object
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_slots ⇒ Object
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_slots ⇒ Object
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_slots ⇒ Object
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 |