Class: DependencyInjection::Loaders::Yaml

Inherits:
Object
  • Object
show all
Defined in:
lib/dependency_injection/loaders/yaml.rb

Instance Method Summary collapse

Constructor Details

#initialize(container) ⇒ Yaml

Returns a new instance of Yaml.



6
7
8
# File 'lib/dependency_injection/loaders/yaml.rb', line 6

def initialize(container)
  @container = container
end

Instance Method Details

#load(filename) ⇒ Object



10
11
12
13
14
# File 'lib/dependency_injection/loaders/yaml.rb', line 10

def load(filename)
  file = YAML::load_file(filename)
  add_parameters(file['parameters']) if file['parameters']
  add_services(file['services']) if file['services']
end