Class: CodeGenerator

Inherits:
Object show all
Includes:
InstanceHelpers
Defined in:
lib/code_generator/code_generator.rb

Constant Summary collapse

TAB =
"  "

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from InstanceHelpers

#lib_enum_postfix, #lib_prefix

Constructor Details

#initialize(types, root_dir) ⇒ CodeGenerator

Returns a new instance of CodeGenerator.



12
13
14
15
# File 'lib/code_generator/code_generator.rb', line 12

def initialize(types, root_dir)
  @types = types
  @root_dir = root_dir
end

Instance Attribute Details

#root_dirObject

Returns the value of attribute root_dir.



8
9
10
# File 'lib/code_generator/code_generator.rb', line 8

def root_dir
  @root_dir
end

#typesObject

Returns the value of attribute types.



7
8
9
# File 'lib/code_generator/code_generator.rb', line 7

def types
  @types
end

Instance Method Details

#generate_self_codeObject



17
18
19
20
# File 'lib/code_generator/code_generator.rb', line 17

def generate_self_code
  generateModules(types)
  generateReadme(types)
end