Class: HookR::InternalCallback
- Inherits:
-
BlockCallback
- Object
- Struct
- Callback
- BlockCallback
- HookR::InternalCallback
- Defined in:
- lib/hookr.rb
Overview
A callback which will execute in the context of the event source
Instance Attribute Summary
Attributes inherited from BlockCallback
Attributes inherited from Callback
Instance Method Summary collapse
- #call(event) ⇒ Object
-
#initialize(handle, block, index) ⇒ InternalCallback
constructor
A new instance of InternalCallback.
Methods inherited from Callback
Constructor Details
#initialize(handle, block, index) ⇒ InternalCallback
Returns a new instance of InternalCallback.
597 598 599 600 |
# File 'lib/hookr.rb', line 597 def initialize(handle, block, index) assert(block.arity <= 0) super(handle, block, index) end |
Instance Method Details
#call(event) ⇒ Object
602 603 604 |
# File 'lib/hookr.rb', line 602 def call(event) event.source.instance_eval(&block) end |