Module HookR
In: lib/hookr.rb

HookR is a library providing "hooks", aka "signals and slots", aka "events" to your Ruby classes.

Methods

Classes and Modules

Module HookR::Hooks

Constants

Hook = Struct.new(:name, :parent, :params) do include FailFast::Assertions   A single named hook

Public Class methods

Public Instance methods

Add a callback which will pass only the event object to block - it will not try to pass arguments as well.

Add a callback which will be executed in the context where it was defined

Add a callback which will be executed in the context of the event source

Add a callback which will send the given message to the event source

Empty this hook of its own AND parent callbacks. This also disconnects the hook from its parent, if any.

Empty this hook of callbacks. Parent hooks may still have callbacks.

Yields callbacks in order of addition, starting with any parent hooks

Yields callbacks in reverse order of addition, starting with own callbacks and then moving on to any parent hooks.

Excute the callbacks in order. source is the object initiating the event.

Returns true if this hook has a null parent

Returns false. Only true of NullHook.

Callback count including parents

[Validate]