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.



577
578
579
580
# File 'lib/hookr.rb', line 577

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

Instance Method Details

#call(event) ⇒ Object



582
583
584
# File 'lib/hookr.rb', line 582

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