class Hooks::Handler(T)

Overview

Wraps event handling callbacks

# Create with proc
handler = Handler(Int32).new(->(data : Int32) { puts data })

# Create with block
handler = Handler(Int32).new { |data| puts data }

Defined in:

hooks/hook.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(proc : T -> _) #

[View source]
def self.new(&block : T -> Nil) #

[View source]

Instance Method Detail

def call(value : T) #

[View source]