class EventHandler::AddHandlerEvent

Overview

Meta event, emitted whenever a handler is added for any event, including itself.

When AddHandlerEvent and RemoveHandlerEvent are emitted, they invoke their handlers with the Wrapper object. A wrapper object for each handler is implicitly created on every on(), and in addition to providing access to the handlers themselves, wrappers also contain the values of arguments used during handler subscription (values of once?, async?, and at). This allows listeners on these meta events full insight into the added handlers and their settings.

Defined in:

Constructors

Instance Method Summary

Constructor Detail

def self.new(event : ::EventHandler::Event.class, wrapper : EventHandler::Wrapper(Proc(Event, Nil))) #

Instance Method Detail

def clone #

def copy_with(event _event = @event, wrapper _wrapper = @wrapper) #

def event : ::EventHandler::Event.class #

def wrapper : EventHandler::Wrapper(Proc(Event, Nil)) #