Sha256: d4507dd4a4435e2660b0e0d3afec5558774119a25d7cea9b04fd9c2b503f144d

Contents?: true

Size: 505 Bytes

Versions: 106

Compression:

Stored size: 505 Bytes

Contents

class Module
  # Returns the class name of a full module namespace path
  #
  # @example
  #   module A::B::C; class_name end # => "C"
  # @return [String] the last part of a module path
  def class_name
    name.split("::").last
  end

  # Returns the module namespace path minus the class/module name
  #
  # @example
  #   module A::B::C; namespace_name end # => "A::B"
  # @return [String] the namespace minus the class/module name
  def namespace_name
    name.split("::")[0..-2].join("::")
  end
end

Version data entries

106 entries across 86 versions & 10 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.5.2/lib/yard/core_ext/module.rb
challah-1.0.0.beta vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
yard-0.8.5.2 lib/yard/core_ext/module.rb
yard-0.8.5.1 lib/yard/core_ext/module.rb
yard-0.8.5 lib/yard/core_ext/module.rb
challah-0.9.1.beta.3 vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
yard-0.8.4.1 lib/yard/core_ext/module.rb
yard-0.8.4 lib/yard/core_ext/module.rb
challah-0.9.1.beta vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
challah-0.9.0 vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-rolls-0.2.0 vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.8.3 vendor/bundle/gems/yard-0.8.3/lib/yard/core_ext/module.rb
yard-0.8.3 lib/yard/core_ext/module.rb
challah-0.8.1 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-rolls-0.1.0 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb