module Events

Defined in:

Events.cr
Events/Event.cr
Events/Handler.cr
Events/Helper.cr
Events/version.cr

Constant Summary

VERSION = "0.1.0"

Instance Method Summary

Instance Method Detail

def clear_handlers(name) #

[View source]
def event_exists(name : String) #

Check if an event with name exists


[View source]
def invoke_event(list : Array(_), *args) #

[View source]
def invoke_event(name, *args) #

Invoke an event given by name, returns an Int32 with the amount of handlers run, false if the event didn't exist


[View source]
def on(list : Array(_), &block) #

[View source]
def on(name, &block) #

Add a block to the given event, returns a proc that removes the block

Creates the event if it doesn't exist already


[View source]
def register_event(list : Array(_)) #

[View source]
def register_event(name) #

Registers a new event, gives it a name and returns it. If the event already exists, it's returned


[View source]
def remove_handler(name, &block) #

Removes a block from an event given by name


[View source]
def unregister_event(name) #

Unregisters the the event given by name


[View source]