aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorTomer Brisker <tbrisker@gmail.com>2016-09-13 16:09:29 +0300
committerTomer Brisker <tbrisker@gmail.com>2016-09-13 16:09:29 +0300
commit2f3637d3cdb737838f17b02d8aa78530d7c7adaa (patch)
treeafc03db9b12d1e4ef57b25e89f69de7d79017d42 /activesupport
parent16b1816b1ac2204ec8a88436b8b170d0356ee8e5 (diff)
downloadrails-2f3637d3cdb737838f17b02d8aa78530d7c7adaa.tar.gz
rails-2f3637d3cdb737838f17b02d8aa78530d7c7adaa.tar.bz2
rails-2f3637d3cdb737838f17b02d8aa78530d7c7adaa.zip
Clarify that mattr_* creates public methods
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/core_ext/module/attribute_accessors.rb6
1 files changed, 6 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
index 90989f4f3d..c3a1b84d3e 100644
--- a/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
+++ b/activesupport/lib/active_support/core_ext/module/attribute_accessors.rb
@@ -8,6 +8,8 @@ class Module
# Defines a class attribute and creates a class and instance reader methods.
# The underlying class variable is set to +nil+, if it is not previously
# defined.
+ # Note: Both methods will be public even if this method is called from
+ # inside a private or protected block.
#
# module HairColors
# mattr_reader :hair_colors
@@ -77,6 +79,8 @@ class Module
# Defines a class attribute and creates a class and instance writer methods to
# allow assignment to the attribute.
+ # Note: Both methods will be public even if this method is called from
+ # inside a private or protected block.
#
# module HairColors
# mattr_writer :hair_colors
@@ -142,6 +146,8 @@ class Module
alias :cattr_writer :mattr_writer
# Defines both class and instance accessors for class attributes.
+ # Note: All methods will be public even if this method is called from
+ # inside a private or protected block.
#
# module HairColors
# mattr_accessor :hair_colors