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)

14
15
16
17
18
19
20
21
22
23
# File 'lib/puppet/runtime.rb', line 14

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


25
26
27
# File 'lib/puppet/runtime.rb', line 25

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

#clearObject

for testing


30
31
32
# File 'lib/puppet/runtime.rb', line 30

def clear
  initialize
end