Module Observable
In: lib/observer.rb

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.

Methods

Public Instance methods

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

Set the changed state of this object. Notifications will be sent only if the changed state is true.

Query the changed state of this object.

Return the number of observers associated with this object.

Delete observer as an observer on this object. It will no longer receive notifications.

Delete all observers associated with this object.

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.

[Validate]

ruby-doc.org is a service of James Britt and Neurogami, a Ruby application development company in Phoenix, AZ.

Documentation content on ruby-doc.org is provided by remarkable members of the Ruby community.

For more information on the Ruby programming language, visit ruby-lang.org.

Want to help improve Ruby's API docs? See Ruby Documentation Guidelines.