Methods
- A
- C
- I
- N
- O
Instance Public methods
Add a new observer to the pool. The new observer needs to respond to ‘update’, otherwise it raises an ArgumentError exception.
Total number of observers.
Instantiate the global observers.
Notify list of observers of a change.
Gets the current observer instances.
Gets an array of observers observing this model. The array also provides enable and disable methods that allow you to selectively enable and disable observers. (see ActiveModel::ObserverArray.enable and ActiveModel::ObserverArray.disable for more on this)
Active Model Observers Activation
Activates the observers assigned. Examples:
class ORM include ActiveModel::Observing end # Calls PersonObserver.instance ORM.observers = :person_observer # Calls Cacher.instance and GarbageCollector.instance ORM.observers = :cacher, :garbage_collector # Same as above, just using explicit class references ORM.observers = Cacher, GarbageCollector
Note: Setting this does not instantiate the observers yet. instantiate_observers is called during startup, and before each development request.
Instance Protected methods