Class: HookR::BasicCallback

Inherits:
BlockCallback show all
Defined in:
lib/hookr.rb

Overview

A callback which will call a one-arg block with an event object

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) ⇒ BasicCallback

Returns a new instance of BasicCallback.



540
541
542
543
# File 'lib/hookr.rb', line 540

def initialize(handle, block, index)
  check_arity!(block)
  super
end

Instance Method Details

#call(event) ⇒ Object



545
546
547
# File 'lib/hookr.rb', line 545

def call(event)
  block.call(event)
end