Class: Puppet::Runtime

Inherits:
Object show all
Includes:
Singleton
Defined in:
lib/puppet/runtime.rb

Instance Method Summary collapse

Instance Method Details

#[](name) ⇒ Object

Raises:

  • (ArgumentError)

11
12
13
14
15
16
17
18
19
20
# File 'lib/puppet/runtime.rb', line 11

def [](name)
  service = @runtime_services[name]
  raise ArgumentError, "Unknown service #{name}" unless service

  if service.is_a?(Proc)
    @runtime_services[name] = service.call
  else
    service
  end
end

#[]=(name, impl) ⇒ Object


22
23
24
# File 'lib/puppet/runtime.rb', line 22

def []=(name, impl)
  @runtime_services[name] = impl
end