Sha256: 36c1ae14d4d88437ffa4358b993f9a68a33f4b84be7735326f9d4d8e0b1869ce

Contents?: true

Size: 737 Bytes

Versions: 82

Compression:

Stored size: 737 Bytes

Contents

class Module
  # A module may or may not have a name.
  #
  #   module M; end
  #   M.name # => "M"
  #
  #   m = Module.new
  #   m.name # => nil
  #
  # +anonymous?+ method returns true if module does not have a name, false otherwise:
  #
  #   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:
  #
  #   m = Module.new # creates an anonymous module
  #   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
end

Version data entries

82 entries across 79 versions & 11 rubygems

Version Path
files.com-1.0.55 docs/vendor/bundle/ruby/2.5.0/gems/activesupport-5.0.7.1/lib/active_support/core_ext/module/anonymous.rb
sigterm_extensions-0.0.4 lib/sigterm_extensions/core_ext/module/anonymous.rb
activesupport-5.1.7 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.7.rc1 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.6.2 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.0.7.2 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.6.1 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.0.7.1 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.6 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.0.7 lib/active_support/core_ext/module/anonymous.rb
tdiary-5.0.8 vendor/bundle/gems/activesupport-5.1.5/lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.5 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.5.rc1 lib/active_support/core_ext/module/anonymous.rb
pract6-0.1.0 .gem/ruby/2.3.0/gems/activesupport-5.1.4/lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.4 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.0.6 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.4.rc1 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.0.6.rc1 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.3 lib/active_support/core_ext/module/anonymous.rb
activesupport-5.1.3.rc3 lib/active_support/core_ext/module/anonymous.rb