Class: DependencyInjection::Loaders::Yaml
- Inherits:
-
Object
- Object
- DependencyInjection::Loaders::Yaml
- Defined in:
- lib/dependency_injection/loaders/yaml.rb
Instance Method Summary collapse
-
#initialize(container) ⇒ Yaml
constructor
A new instance of Yaml.
- #load(filename) ⇒ Object
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 |