diff options
author | Sean Griffin <sean@seantheprogrammer.com> | 2017-07-17 10:53:59 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-07-17 10:53:59 -0400 |
commit | 828b05f5f9f8decf55170ea75bfdc6d37787993d (patch) | |
tree | 5fc633a91dd919f69ab8dd5d26af149d3cb88e4d /activesupport/lib | |
parent | 8e06f09875d7c935c69f137c3b992a35b782daa0 (diff) | |
parent | 5fa6563f09cd1ee84860364195249a9f7faa26a7 (diff) | |
download | rails-828b05f5f9f8decf55170ea75bfdc6d37787993d.tar.gz rails-828b05f5f9f8decf55170ea75bfdc6d37787993d.tar.bz2 rails-828b05f5f9f8decf55170ea75bfdc6d37787993d.zip |
Merge pull request #29758 from glaucocustodio/patch-1 [ci skip]
Add documentation for class_attribute default option
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/class/attribute.rb | 10 |
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 a72dbc7bf0..e5a52db36a 100644 --- a/activesupport/lib/active_support/core_ext/class/attribute.rb +++ b/activesupport/lib/active_support/core_ext/class/attribute.rb @@ -8,6 +8,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 |