提交 7536731a 编写于 作者: O Oscar Del Ben

Improve observers documentation

上级 3333fe28
......@@ -214,6 +214,7 @@ def observed_class
end
# Start observing the declared classes and their subclasses.
# Called automatically by the instance method.
def initialize
observed_classes.each { |klass| add_observer!(klass) }
end
......@@ -242,6 +243,7 @@ def add_observer!(klass) #:nodoc:
klass.add_observer(self)
end
# Returns true if notifications are disabled for this object.
def disabled_for?(object)
klass = object.class
return false unless klass.respond_to?(:observers)
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册