Method: Module#homename

Defined in:
lib/core/facets/module/home.rb

#homenameObject Also known as: modname

Returns the name of module or class containing the receiver.

module ::HomeExample
  module M
    module N
    end
  end
end

HomeExample::M::N.homename  #=> "HomeExample::M"

See also Module#basename.



57
58
59
# File 'lib/core/facets/module/home.rb', line 57

def homename
  /::[^:]+\Z/ =~ name ? $` : nil
end