Module

Observable

Implements the Observable design pattern as a mixin so that other objects can be notified of changes in state. See observer.rb for details and an example.

Public Methods
add_observer Add observer as an observer on this object. observer will now receive notifications.
changed Set the changed state of this object. Notifications will be sent only if the changed state is true.
changed? Query the changed state of this object.
count_observers Return the number of observers associated with this object.
delete_observer Delete observer as an observer on this object. It will no longer receive notifications.
delete_observers Delete all observers associated with this object.
notify_observers If this object’s changed state is true, invoke the update method in each currently associated observer in turn, passing it the given arguments. The changed state is then set to false.
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.