Class: BBC::Cosmos::Tools::Config::ProjectConfig

Inherits:
Object
  • Object
show all
Defined in:
lib/bbc/cosmos/tools/config/project_config.rb

Instance Method Summary collapse

Constructor Details

#initialize(config_path, project, env = 'int') ⇒ ProjectConfig

Returns a new instance of ProjectConfig.



10
11
12
13
14
# File 'lib/bbc/cosmos/tools/config/project_config.rb', line 10

def initialize(config_path, project, env = 'int')
  @project = project
  @env = env
  @config_path = config_path
end

Instance Method Details

#componentsObject



16
17
18
# File 'lib/bbc/cosmos/tools/config/project_config.rb', line 16

def components
  config['components'].keys
end

#generate(id) ⇒ Object



20
21
22
# File 'lib/bbc/cosmos/tools/config/project_config.rb', line 20

def generate(id)
  component_config id
end

#generate_cosmos(id) ⇒ Object



24
25
26
27
28
# File 'lib/bbc/cosmos/tools/config/project_config.rb', line 24

def generate_cosmos(id)
  generate(id).reduce([]) do |object, (key, value)|
    object.tap { |o| o << {:value => value, :key => key} }
  end
end