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_after_closeString

Returns:

  • (String)


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

def root_module_after_close
  s = root_module_requires.map { |e| "require '#{e}'\n" }.join
  s.present? ? "\n#{s}" : ''
end

#root_module_closeObject



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

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

#root_module_componentsObject



34
35
36
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 34

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

#root_module_inner_identationObject



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

def root_module_inner_identation
  IDENT * root_module_components.count
end

#root_module_openObject



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

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

#root_module_requiresEnumerable<String>

Returns:

  • (Enumerable<String>)


39
40
41
# File 'lib/avm/eac_ruby_base1/source_generators/base/root_module.rb', line 39

def root_module_requires
  []
end