Class: Servitor::YamlConfigurationProvider
- Inherits:
-
Object
- Object
- Servitor::YamlConfigurationProvider
- Defined in:
- lib/configuration/yaml_configuration_provider.rb
Instance Method Summary collapse
-
#initialize(file_path) ⇒ YamlConfigurationProvider
constructor
A new instance of YamlConfigurationProvider.
- #resources_for(service_name) ⇒ Object
- #variables_for(service_name) ⇒ Object
Constructor Details
#initialize(file_path) ⇒ YamlConfigurationProvider
Returns a new instance of YamlConfigurationProvider.
5 6 7 |
# File 'lib/configuration/yaml_configuration_provider.rb', line 5 def initialize(file_path) @file_path = file_path end |
Instance Method Details
#resources_for(service_name) ⇒ Object
16 17 18 19 |
# File 'lib/configuration/yaml_configuration_provider.rb', line 16 def resources_for(service_name) resources = yaml['resources'] || {} resources[service_name] || {} end |
#variables_for(service_name) ⇒ Object
9 10 11 12 13 14 |
# File 'lib/configuration/yaml_configuration_provider.rb', line 9 def variables_for(service_name) services = yaml['services'] || {} service_vars = services[service_name] || {} common_vars = services['common'] || {} common_vars.merge(service_vars) end |