Sha256: c9c27739c3642f241c876e8fe74e58ee32f07688648b2db8a2ae9bd7625d8c07

Contents?: true

Size: 456 Bytes

Versions: 8

Compression:

Stored size: 456 Bytes

Contents

require 'puppet/http'
require 'singleton'

class Puppet::Runtime
  include Singleton

  def initialize
    @runtime_services = {}
  end
  private :initialize

  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

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
puppet-6.13.0 lib/puppet/runtime.rb
puppet-6.13.0-x86-mingw32 lib/puppet/runtime.rb
puppet-6.13.0-x64-mingw32 lib/puppet/runtime.rb
puppet-6.13.0-universal-darwin lib/puppet/runtime.rb
puppet-6.12.0 lib/puppet/runtime.rb
puppet-6.12.0-x86-mingw32 lib/puppet/runtime.rb
puppet-6.12.0-x64-mingw32 lib/puppet/runtime.rb
puppet-6.12.0-universal-darwin lib/puppet/runtime.rb