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.



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