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.
575 576 577 578 |
# File 'lib/hookr.rb', line 575 def initialize(handle, block, index) assert(block.arity <= 0) super(handle, block, index) end |
Instance Method Details
#call(event) ⇒ Object
580 581 582 |
# File 'lib/hookr.rb', line 580 def call(event) event.source.instance_eval(&block) end |