diff options
author | Yves Senn <yves.senn@gmail.com> | 2015-10-23 08:38:10 +0200 |
---|---|---|
committer | Yves Senn <yves.senn@gmail.com> | 2015-10-23 08:38:10 +0200 |
commit | 2ad9afe4ff2c12d1a9e4a00d9009d040e636c9b0 (patch) | |
tree | f7c31f2046087be92d20ca5d8af1d6797e129dda /activesupport | |
parent | b9d1e101b4982dd9c9359b2824589c3783effa26 (diff) | |
parent | f3de0c185aae346cf9ffc0b0b327ee6fb0f8a67e (diff) | |
download | rails-2ad9afe4ff2c12d1a9e4a00d9009d040e636c9b0.tar.gz rails-2ad9afe4ff2c12d1a9e4a00d9009d040e636c9b0.tar.bz2 rails-2ad9afe4ff2c12d1a9e4a00d9009d040e636c9b0.zip |
Merge pull request #22035 from yui-knk/update_doc_anonymous
[ci skip] Add more code examples for `Module#anonymous?` docs
Diffstat (limited to 'activesupport')
-rw-r--r-- | activesupport/lib/active_support/core_ext/module/anonymous.rb | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/activesupport/lib/active_support/core_ext/module/anonymous.rb b/activesupport/lib/active_support/core_ext/module/anonymous.rb index 0ecc67a855..510c9a5430 100644 --- a/activesupport/lib/active_support/core_ext/module/anonymous.rb +++ b/activesupport/lib/active_support/core_ext/module/anonymous.rb @@ -7,7 +7,7 @@ class Module # m = Module.new # m.name # => nil # - # +anonymous?+ method returns true if module does not have a name: + # +anonymous?+ method returns true if module does not have a name, false otherwise: # # Module.new.anonymous? # => true # @@ -18,8 +18,10 @@ class Module # via the +module+ or +class+ keyword or by an explicit assignment: # # m = Module.new # creates an anonymous module - # M = m # => m gets a name here as a side-effect + # m.anonymous? # => true + # M = m # m gets a name here as a side-effect # m.name # => "M" + # m.anonymous? # => false def anonymous? name.nil? end |