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-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.8.0.pre vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.7.1 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.7.0 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.7.0.pre2 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.7.0.pre vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
challah-0.6.2 vendor/bundle/gems/yard-0.7.5/lib/yard/core_ext/module.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.1/lib/yard/core_ext/module.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/module.rb
challah-0.6.2 vendor/bundle/gems/yard-0.8.2.1/lib/yard/core_ext/module.rb
yard-0.8.2.1 lib/yard/core_ext/module.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.2/lib/yard/core_ext/module.rb
challah-0.6.1 vendor/bundle/gems/yard-0.8.1/lib/yard/core_ext/module.rb
challah-0.6.1 vendor/bundle/gems/yard-0.7.5/lib/yard/core_ext/module.rb
yard-0.8.2 lib/yard/core_ext/module.rb
challah-0.6.0 vendor/bundle/gems/yard-0.8.1/lib/yard/core_ext/module.rb
challah-0.6.0 vendor/bundle/gems/yard-0.7.5/lib/yard/core_ext/module.rb
yard-0.8.1 lib/yard/core_ext/module.rb
yard-0.8.0 lib/yard/core_ext/module.rb
challah-0.5.4 vendor/bundle/gems/yard-0.7.5/lib/yard/core_ext/module.rb