observer.rb

Path: src/org/puremvc/ruby/patterns/observer/observer.rb
Last Update: Mon Dec 29 20:04:31 -0600 2008

An Observer is an object that encapsulates information about an interested object with a method that should be called when a particular Notification is broadcast.

In PureMVC, the Observer class assumes these responsibilities:

  • Encapsulate the notification (callback) method of the interested object.
  • Encapsulate the notification context (this) of the interested object.
  • Provide methods for setting the notification method and context.
  • Provide a method for notifying the interested object.

[Validate]