Permalink
Browse files

updating description of how class_attribute works

  • Loading branch information...
1 parent 67e79cf commit f3b50b11c7cba1ae21888c755cbeabf3b3aca072 Neeraj Singh committed Jul 28, 2010
Showing with 5 additions and 0 deletions.
  1. +5 −0 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.
#

0 comments on commit f3b50b1

Please sign in to comment.