Module | Core::Patterns::Observer |
In: |
core/patterns.rb
|
Implementation of the Observer pattern, this module defines a single method: notify. Observable objects will invoke this method of their observers every time an event to which the observer is registered is signaled.
This method is invoked by the Observable object if the Observer is associated with the event being signaled. The default implementation provided by this module raises an exception Observer classes are expected to override this behaviour.
# File core/patterns.rb, line 33 def notify(event, *args) raise "#{self.class.name} (#{self.inspect}) does not implement a valid notify() function. Event notified: #{event} (#{args})" end