diff options
author | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-28 15:01:05 -0300 |
---|---|---|
committer | Rafael Mendonça França <rafaelmfranca@gmail.com> | 2015-02-28 15:01:05 -0300 |
commit | cd545d2399c27c76aa956c6844e38669451bafd1 (patch) | |
tree | 2a0c7bb8bb319ed7c004c478eb675ef9ce43704f | |
parent | 9b4d8b8fbe26cabbda3adb9dda144183911a211b (diff) | |
parent | 92dce324b95678d142f8e1967a9ec16bf1efc250 (diff) | |
download | rails-cd545d2399c27c76aa956c6844e38669451bafd1.tar.gz rails-cd545d2399c27c76aa956c6844e38669451bafd1.tar.bz2 rails-cd545d2399c27c76aa956c6844e38669451bafd1.zip |
Merge pull request #19132 from davydovanton/pdate-doc-module-anonymous
[ci skip] Add code examples for Module#anonymous? documentation
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/anonymous.rb | 7 |
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: # |