提交 9297027e 编写于 作者: X Xavier Noria

copy-edits 6d7a8267

上级 843a5b9a
......@@ -48,7 +48,7 @@ def instantiate_observers
observers.each { |o| instantiate_observer(o) }
end
# Add a new Observer to the pool
# Add a new observer to the pool.
def add_observer(observer)
unless observer.respond_to? :update
raise ArgumentError, "observer needs to respond to `update'"
......@@ -56,14 +56,14 @@ def add_observer(observer)
observer_instances << observer
end
# Notify list of observers of a change
# Notify list of observers of a change.
def notify_observers(*arg)
for observer in observer_instances
observer.update(*arg)
end
end
# Total number of observers
# Total number of observers.
def count_observers
observer_instances.size
end
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册