Module: Avm::EacRubyBase1::SourceGenerators::Base::RootModule

Defined in:
lib/avm/eac_ruby_base1/source_generators/base/root_module.rb

Instance Method Summary collapse

Instance Method Details

#root_moduleObject



8
9
10
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 8

def root_module
  lib_path.camelize
end

#root_module_closeObject



12
13
14
15
16
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 12

def root_module_close
  root_module_components.count.times.map do |index|
    "#{IDENT * index}end"
  end.reverse.join("\n")
end

#root_module_componentsObject



28
29
30
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 28

def root_module_components
  root_module.split('::')
end

#root_module_inner_identationObject



18
19
20
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 18

def root_module_inner_identation
  IDENT * root_module_components.count
end

#root_module_openObject



22
23
24
25
26
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 22

def root_module_open
  root_module_components.each_with_index.map do |component, index|
    "#{IDENT * index}module #{component}"
  end.join("\n")
end