Module: Metaractor::Namespace::ClassMethods

Defined in:
lib/metaractor/namespace.rb

Instance Method Summary collapse

Instance Method Details

#i18n_parent_namesObject



28
29
30
# File 'lib/metaractor/namespace.rb', line 28

def i18n_parent_names
  module_parent_names.map { |name| underscore_module_name(name).to_sym }
end

#module_parent_nameObject



10
11
12
13
14
15
16
17
18
# File 'lib/metaractor/namespace.rb', line 10

def module_parent_name
  if defined?(@parent_name)
    @parent_name
  else
    parent_name = (name =~ /::[^:]+\z/) ? -$` : nil
    @parent_name = parent_name unless frozen?
    parent_name
  end
end

#module_parent_namesObject



20
21
22
23
24
25
26
# File 'lib/metaractor/namespace.rb', line 20

def module_parent_names
  parents = []
  if module_parent_name
    parents = module_parent_name.split("::")
  end
  parents
end