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_file_location, template, output_dir) ⇒ Config

Returns a new instance of Config.

Parameters:

  • source_file_location (String)
  • template (Cure::Template)
  • output_dir (String)


47
48
49
50
51
# File 'lib/cure/config.rb', line 47

def initialize(source_file_location, template, output_dir)
  @source_file_location = source_file_location
  @template = template
  @output_dir = output_dir
end

Instance Attribute Details

#output_dirObject

Returns the value of attribute output_dir.



36
37
38
# File 'lib/cure/config.rb', line 36

def output_dir
  @output_dir
end

#source_file_locationObject

Returns the value of attribute source_file_location.



36
37
38
# File 'lib/cure/config.rb', line 36

def source_file_location
  @source_file_location
end

#templateCure::Template

Returns template.

Returns:



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

def template
  @template
end

#variablesHash

Returns variables.

Returns:

  • (Hash)

    variables



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

def variables
  @variables
end

Instance Method Details

#placeholdersObject



53
54
55
# File 'lib/cure/config.rb', line 53

def placeholders
  @template.transformations.placeholders || {}
end