Sha256: f8db552f9efd7b06b2ca5c363101096f4e7a1fb96147e368d80ad56f34cd17d6

Contents?: true

Size: 524 Bytes

Versions: 5

Compression:

Stored size: 524 Bytes

Contents

require 'puppet/indirector/terminus'

# Manage a memory-cached list of instances.
class Puppet::Indirector::Memory < Puppet::Indirector::Terminus
    def initialize
        @instances = {}
    end

    def destroy(instance)
        raise ArgumentError.new("Could not find %s to destroy" % instance) unless @instances.include?(instance.name)
        @instances.delete(instance.name)
    end

    def find(name)
        @instances[name]
    end

    def save(instance)
        @instances[instance.name] = instance
    end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
puppet-0.24.0 lib/puppet/indirector/memory.rb
puppet-0.24.1 lib/puppet/indirector/memory.rb
puppet-0.24.2 lib/puppet/indirector/memory.rb
puppet-0.24.3 lib/puppet/indirector/memory.rb
puppet-0.24.4 lib/puppet/indirector/memory.rb