Class: Kojo::Config
- Inherits:
-
Object
- Object
- Kojo::Config
- Defined in:
- lib/kojo/config.rb
Overview
The Config class handles multiple template generation from a definitions YAML file.
Instance Attribute Summary collapse
-
#config_file ⇒ Object
readonly
Returns the value of attribute config_file.
-
#import_base ⇒ Object
Returns the value of attribute import_base.
-
#outdir ⇒ Object
readonly
Returns the value of attribute outdir.
Instance Method Summary collapse
- #generate(opts = {}, &block) ⇒ Object
-
#initialize(config_file) ⇒ Config
constructor
A new instance of Config.
Constructor Details
#initialize(config_file) ⇒ Config
Returns a new instance of Config.
10 11 12 13 |
# File 'lib/kojo/config.rb', line 10 def initialize(config_file) @config_file = config_file @import_base = nil end |
Instance Attribute Details
#config_file ⇒ Object (readonly)
Returns the value of attribute config_file.
7 8 9 |
# File 'lib/kojo/config.rb', line 7 def config_file @config_file end |
#import_base ⇒ Object
Returns the value of attribute import_base.
8 9 10 |
# File 'lib/kojo/config.rb', line 8 def import_base @import_base end |
#outdir ⇒ Object (readonly)
Returns the value of attribute outdir.
7 8 9 |
# File 'lib/kojo/config.rb', line 7 def outdir @outdir end |
Instance Method Details
#generate(opts = {}, &block) ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/kojo/config.rb', line 15 def generate(opts = {}, &block) if directory_mode? generate_from_dir opts, &block else generate_from_file opts, &block end end |