Class: Cure::Configuration::Config

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

Constructor Details

#initialize(source_files, template) ⇒ Config

Returns a new instance of Config.

Parameters:



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_filesObject

Returns the value of attribute source_files.



38
39
40
# File 'lib/cure/config.rb', line 38

def source_files
  @source_files
end

#templateCure::Template

Returns:

  • (Cure::Template)


41
42
43
# File 'lib/cure/config.rb', line 41

def template
  @template
end

Instance Method Details

#placeholdersObject



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