Class: Cure::Configuration::Config
- Inherits:
-
Object
- Object
- Cure::Configuration::Config
- Defined in:
- lib/cure/config.rb
Overview
If we are overloading here as a “data store” and “config store”, we could break out variables and placeholders into their own singleton.
This should be a kind of instance cache, which loads once per run, and junk can be jammed in there?
Instance Attribute Summary collapse
-
#source_files ⇒ Object
Returns the value of attribute source_files.
- #template ⇒ Cure::Template
Instance Method Summary collapse
-
#initialize(source_files, template) ⇒ Config
constructor
A new instance of Config.
- #placeholders ⇒ Object
- #with_source_file(&block) ⇒ Object
Constructor Details
#initialize(source_files, template) ⇒ Config
Returns a new instance of Config.
45 46 47 48 |
# File 'lib/cure/config.rb', line 45 def initialize(source_files, template) @source_files = source_files @template = template end |
Instance Attribute Details
#source_files ⇒ Object
Returns the value of attribute source_files.
38 39 40 |
# File 'lib/cure/config.rb', line 38 def source_files @source_files end |
#template ⇒ Cure::Template
41 42 43 |
# File 'lib/cure/config.rb', line 41 def template @template end |
Instance Method Details
#placeholders ⇒ Object
50 51 52 |
# File 'lib/cure/config.rb', line 50 def placeholders @template.transformations.placeholders || {} end |
#with_source_file(&block) ⇒ Object
54 55 56 57 58 |
# File 'lib/cure/config.rb', line 54 def with_source_file(&block) @source_files.each_with_index do |file, _idx| file.with_file(&block) end end |