class EventHandler::Wrapper(T)

Overview

Generic class wrapping each installed handler.

This class is generally not used directly, but is implicitly created and returned in response to on().

It is also sent as an argument to emitted AddHandlerEvent and RemoveHandlerEvent events.

It holds settings associated with each installed handler; its values for once, async, and at (the initial insertion position in the list of handlers).

at value is informational. Probably best use is to check for values of 0 or -1, indicating the handler's insertion at the beginning or end of list respectively.

Defined in:

wrapper.cr

Constructors

Instance Method Summary

Constructor Detail

def self.new(handler : T, once : Bool = false, async : Bool = ::EventHandler.async?, at : Int32 = ::EventHandler.at_end, hash = nil) #

[View source]
def self.new(once = false, async = ::EventHandler.async?, at = ::EventHandler.at_end, hash = nil, &handler : T) #

[View source]

Instance Method Detail

def async? : Bool #

[View source]
def at : Int32 #

[View source]
def call(obj, async = nil) #

[View source]
def handler : T #

[View source]
def handler_hash : UInt64 #

[View source]
def once? : Bool #

[View source]