- Inheritance
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
Instance
Visibility | Signature |
---|---|
public | add_observer (observer) |
public | changed (state=true) |
public | changed? () |
public | count_observers () |
public | delete_observer (observer) |
public | delete_observers () |
public | notify_observers (*arg) |
Instance Method Detail
add_observer(observer)
Add observer as an observer on this object. observer will now receive notifications.
changed(state=true)
changed?()
Query the changed state of this object.
count_observers()
Return the number of observers associated with this object.
delete_observer(observer)
Delete observer as an observer on this object. It will no longer receive notifications.
delete_observers()
Delete all observers associated with this object.