Class: Conflate::Conflator

Inherits:
Object
  • Object
show all
Defined in:
lib/conflate/conflator.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(path, config) ⇒ Conflator

Public: Initialize a new Conflator

path - Path the directory containing YAML configs (e.g., Rails.root.join(“config”)) config - Object to receive the config entries (e.g., Rails.application.config)



20
21
22
23
# File 'lib/conflate/conflator.rb', line 20

def initialize(path, config)
  self.path = path
  self.config = config
end

Instance Attribute Details

#configObject

Returns the value of attribute config.



14
15
16
# File 'lib/conflate/conflator.rb', line 14

def config
  @config
end

#pathObject

Returns the value of attribute path.



14
15
16
# File 'lib/conflate/conflator.rb', line 14

def path
  @path
end

Instance Method Details

#performObject

Public: Process the configuration



26
27
28
29
30
# File 'lib/conflate/conflator.rb', line 26

def perform
  config_paths.each do |filename|
    Conflation.new(filename, config).apply
  end
end