From 7536731a9ac5668a81c2581697edf25e1341519e Mon Sep 17 00:00:00 2001 From: Oscar Del Ben Date: Wed, 18 Apr 2012 15:23:06 +0200 Subject: Improve observers documentation --- activemodel/lib/active_model/observing.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/activemodel/lib/active_model/observing.rb b/activemodel/lib/active_model/observing.rb index 29687866e3..fc84b52dd9 100644 --- a/activemodel/lib/active_model/observing.rb +++ b/activemodel/lib/active_model/observing.rb @@ -214,6 +214,7 @@ module ActiveModel 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 @@ module ActiveModel 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) -- cgit v1.2.3