Methods
- A
- C
- I
- N
- O
Instance Public methods
add_observer(observer)
Link
Add a new observer to the pool. The new observer needs to respond to
'update', otherwise it raises an ArgumentError
exception.
count_observers()
Link
Total number of observers.
instantiate_observers()
Link
Instantiate the global observers.
notify_observers(*arg)
Link
Notify list of observers of a change.
observer_instances()
Link
Gets the current observer instances.
observers()
Link
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)
observers=(*values)
Link
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