I am using the observer pattern that comes with the standard Ruby
distribution and found that the publisher allows the same observer
to be ‘added’ more than once.
code from observer.rb
@observer_peers =  unless defined? @observer_peers
unless observer.respond_to? :update
raise NoMethodError, “observer needs to respond to `update’”
I was wondering if it would make sense to change the last but one
line in method ‘add_observer’ to
@observer_peers.push observer if not
In other words, am I missing an obvious reason for a publisher to
allow an observer to register more than once?