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.
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_file ⇒ Object (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_base ⇒ Object
Returns the value of attribute import_base.
10 11 12 |
# File 'lib/kojo/config.rb', line 10 def import_base @import_base end |
#outdir ⇒ Object (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 |