class

Ktistec::Observable::Registry(T)

Inherits Reference < Object

Holds observer callbacks for a class's lifecycle events and dispatches them to the affected instance.

Constructors

Instance methods

clear

Removes all registered observers.

For test isolation.

Source
notify(event : Symbol, instance : T) : Nil

Invokes the observers registered for event, in registration order, passing instance.

Source
observe(event : Symbol, &block : T -> ) : Nil

Registers an observer for event.

The block receives the affected instance.

Source