Class: EXEL::ListenInstruction
- Inherits:
-
Object
- Object
- EXEL::ListenInstruction
- Includes:
- Events
- Defined in:
- lib/exel/listen_instruction.rb
Overview
Registers an event listener
Constant Summary
Constants included from Events
Instance Method Summary collapse
- #execute(context) ⇒ Object
-
#initialize(event, listener) ⇒ ListenInstruction
constructor
A new instance of ListenInstruction.
Methods included from Events
included, #register_listener, #trigger
Constructor Details
#initialize(event, listener) ⇒ ListenInstruction
Returns a new instance of ListenInstruction.
10 11 12 13 |
# File 'lib/exel/listen_instruction.rb', line 10 def initialize(event, listener) @event = event @listener = listener end |
Instance Method Details
#execute(context) ⇒ Object
15 16 17 |
# File 'lib/exel/listen_instruction.rb', line 15 def execute(context) register_listener(context, @event, @listener) end |