Class: Kojo::Config

Inherits:
Object
  • Object
show all
Defined in:
lib/kojo/config.rb

Overview

The Config class handles multiple template generation from a definitions YAML file.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(config_file) ⇒ Config

Returns a new instance of Config.



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

def initialize(config_file)
  @config_file = config_file
  @import_base = nil
end

Instance Attribute Details

#config_fileObject (readonly)

Returns the value of attribute config_file.



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

def config_file
  @config_file
end

#import_baseObject

Returns the value of attribute import_base.



10
11
12
# File 'lib/kojo/config.rb', line 10

def import_base
  @import_base
end

#outdirObject (readonly)

Returns the value of attribute outdir.



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

def outdir
  @outdir
end

Instance Method Details

#generate(opts = {}, &block) ⇒ Object



17
18
19
20
21
22
23
# File 'lib/kojo/config.rb', line 17

def generate(opts = {}, &block)
  if directory_mode?
    generate_from_dir opts, &block
  else
    generate_from_file opts, &block
  end
end