aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/module
diff options
context:
space:
mode:
authorAnton Davydov <antondavydov.o@gmail.com>2015-02-28 20:46:21 +0300
committerAnton Davydov <antondavydov.o@gmail.com>2015-02-28 20:58:23 +0300
commit92dce324b95678d142f8e1967a9ec16bf1efc250 (patch)
tree0bf87657d2e7dc3fb239f5c44c0e72de3e3ee634 /activesupport/lib/active_support/core_ext/module
parent1db5ecf1e7c748b0414b5a4369d854c7b2c5541d (diff)
downloadrails-92dce324b95678d142f8e1967a9ec16bf1efc250.tar.gz
rails-92dce324b95678d142f8e1967a9ec16bf1efc250.tar.bz2
rails-92dce324b95678d142f8e1967a9ec16bf1efc250.zip
[ci skip] Add code examples for Module#anonymous? documentation
Diffstat (limited to 'activesupport/lib/active_support/core_ext/module')
-rw-r--r--activesupport/lib/active_support/core_ext/module/anonymous.rb7
1 files changed, 7 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/anonymous.rb b/activesupport/lib/active_support/core_ext/module/anonymous.rb
index b0c7b021db..0ecc67a855 100644
--- a/activesupport/lib/active_support/core_ext/module/anonymous.rb
+++ b/activesupport/lib/active_support/core_ext/module/anonymous.rb
@@ -7,6 +7,13 @@ class Module
# m = Module.new
# m.name # => nil
#
+ # +anonymous?+ method returns true if module does not have a name:
+ #
+ # Module.new.anonymous? # => true
+ #
+ # module M; end
+ # M.anonymous? # => false
+ #
# A module gets a name when it is first assigned to a constant. Either
# via the +module+ or +class+ keyword or by an explicit assignment:
#