Permalink
Browse files

Improve observers documentation

  • Loading branch information...
1 parent 3333fe2 commit 7536731a9ac5668a81c2581697edf25e1341519e @oscardelben oscardelben committed Apr 18, 2012
Showing with 2 additions and 0 deletions.
  1. +2 −0 activemodel/lib/active_model/observing.rb
@@ -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)

0 comments on commit 7536731

Please sign in to comment.