aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorGlauco Custódio <glauco.custodio@gmail.com>2017-07-11 14:19:10 -0300
committerGlauco Custódio <glauco.custodio@gmail.com>2017-07-17 11:36:05 -0300
commit5fa6563f09cd1ee84860364195249a9f7faa26a7 (patch)
treeb8af01320fbe27e88418867231ce0dd8a0d70659 /activesupport
parentfb129373a3f99c70b9d2548312390de2ce6abf91 (diff)
downloadrails-5fa6563f09cd1ee84860364195249a9f7faa26a7.tar.gz
rails-5fa6563f09cd1ee84860364195249a9f7faa26a7.tar.bz2
rails-5fa6563f09cd1ee84860364195249a9f7faa26a7.zip
Add documentation for class_attribute options
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/class/attribute.rb10
1 files changed, 10 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 a6da65e96d..f47736b3b5 100644
--- a/activesupport/lib/active_support/core_ext/class/attribute.rb
+++ b/activesupport/lib/active_support/core_ext/class/attribute.rb
@@ -7,6 +7,16 @@ class Class
# Declare a class-level attribute whose value is inheritable by subclasses.
# Subclasses can change their own value and it will not impact parent class.
#
+ # ==== Options
+ #
+ # * <tt>:instance_reader</tt> - Sets the instance reader method (defaults to true).
+ # * <tt>:instance_writer</tt> - Sets the instance writer method (defaults to true).
+ # * <tt>:instance_accessor</tt> - Sets both instance methods (defaults to true).
+ # * <tt>:instance_predicate</tt> - Sets a predicate method (defaults to true).
+ # * <tt>:default</tt> - Sets a default value for the attribute (defaults to nil).
+ #
+ # ==== Examples
+ #
# class Base
# class_attribute :setting
# end