Module Publisher
In: lib/utility/publisher.rb
Publisher
Module: Publisher

Publisher is a variation on Ruby’s Observable. We do not keep track of any changed state; instead we assume that by virtue of calling publish we have changed state. We do not allow serialization of subscribers. We allow a Publisher to have multiple publications and maintain separate lists of subscribers for each one.

Methods

Public Instance methods

If this object’s changed state is true, invoke the update method in each currently associated subscriber in turn, passing it the given arguments. The changed state is then set to false.

Add subscriber as an subscriber on this object. subscriber will now receive notifications.

Count of subscribers to this object.

Delete subscriber as a subscriber on this object. It will no longer receive notifications.

Delete all subscribers associated with this object.

[Validate]