Module: EventBus::DeclarerBase

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

Defined Under Namespace

Modules: Methods

Instance Method Summary collapse

Instance Method Details

#call_slot(*slots) ⇒ Object



139
140
141
142
143
144
145
146
147
148
# File 'lib/ls4/lib/ebus.rb', line 139

def call_slot(*slots)
  slots.each {|slot|
    slot = slot.to_sym
    s = CallSlot.new(self, slot)
    c = ::EventBus.method2const(slot)
    const = :"EBUS_SLOT_#{c}"
    ebus_def_slot_delegators(const, s)
  }
  self
end

#signal_slot(*slots) ⇒ Object



150
151
152
153
154
155
156
157
158
159
# File 'lib/ls4/lib/ebus.rb', line 150

def signal_slot(*slots)
  slots.each {|slot|
    slot = slot.to_sym
    s = SignalSlot.new(self, slot)
    c = ::EventBus.method2const(slot)
    const = :"EBUS_SLOT_#{c}"
    ebus_def_slot_delegators(const, s)
  }
  self
end