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