Class: HookR::InternalCallback

Inherits:
BlockCallback show all
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

#block

Attributes inherited from Callback

#handle, #index

Instance Method Summary collapse

Methods inherited from Callback

#<=>

Constructor Details

#initialize(handle, block, index) ⇒ InternalCallback

Returns a new instance of InternalCallback.



560
561
562
563
# File 'lib/hookr.rb', line 560

def initialize(handle, block, index)
  assert(block.arity <= 0)
  super(handle, block, index)
end

Instance Method Details

#call(event) ⇒ Object



565
566
567
# File 'lib/hookr.rb', line 565

def call(event)
  event.source.instance_eval(&block)
end