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.



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