class EventHandler::Wrapper(T)
- EventHandler::Wrapper(T)
- Reference
- Object
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.crConstructors
- .new(handler : T, once : Bool = false, async : Bool = ::EventHandler.async?, at : Int32 = ::EventHandler.at_end, hash = nil)
- .new(once = false, async = ::EventHandler.async?, at = ::EventHandler.at_end, hash = nil, &handler : T)
Instance Method Summary
- #async? : Bool
- #at : Int32
- #call(obj, async = nil)
- #handler : T
- #handler_hash : UInt64
- #once? : Bool
Constructor Detail
def self.new(handler : T, once : Bool = false, async : Bool = ::EventHandler.async?, at : Int32 = ::EventHandler.at_end, hash = nil)
#
def self.new(once = false, async = ::EventHandler.async?, at = ::EventHandler.at_end, hash = nil, &handler : T)
#