diff options
author | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-28 09:53:24 -0400 |
---|---|---|
committer | Neeraj Singh <neerajdotname@gmail.com> | 2010-07-28 09:53:38 -0400 |
commit | f3b50b11c7cba1ae21888c755cbeabf3b3aca072 (patch) | |
tree | 44ea5bcd9d6a961b1f8c992eaa554f84ed5c6980 | |
parent | 67e79cf96d6bd27779a659703253984ac47a90ee (diff) | |
download | rails-f3b50b11c7cba1ae21888c755cbeabf3b3aca072.tar.gz rails-f3b50b11c7cba1ae21888c755cbeabf3b3aca072.tar.bz2 rails-f3b50b11c7cba1ae21888c755cbeabf3b3aca072.zip |
updating description of how class_attribute works
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute.rb | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/class/attribute.rb b/activesupport/lib/active_support/core_ext/class/attribute.rb index 83b2695606..cee3f04354 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -18,6 +18,11 @@ class Class # Subclass.setting # => false # Base.setting # => true # + # In the above case as long as Subclass does not assign a value to setting + # by performing <tt>Subclass.setting = _something_ </tt>, <tt>Subclass.setting</tt> + # would read value assigned to parent class. Once Subclass assigns a value then + # the value assigned by Subclass would be returned. + # # This matches normal Ruby method inheritance: think of writing an attribute # on a subclass as overriding the reader method. # |