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.



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

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

Instance Attribute Details

#root_dirObject

Returns the value of attribute root_dir.



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

def root_dir
  @root_dir
end

#typesObject

Returns the value of attribute types.



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

def types
  @types
end

Instance Method Details

#generate_self_codeObject



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

def generate_self_code
  generateModules(types)
  generateReadme(types)
end