Sha256: 2325883e4238c57dd9ba77fbff9355e43415fb24e40483a95a9594d2a12d7708

Contents?: true

Size: 549 Bytes

Versions: 9

Compression:

Stored size: 549 Bytes

Contents

# frozen_string_literal: true

module PuppetfileResolver
  module Cache
    class Base
      def initialize(*_)
        @inmemory = {}
      end

      def exist?(name)
        @inmemory.key?(name)
      end

      def load(name)
        @inmemory[name]
      end

      def save(name, value, persist = false)
        @inmemory[name] = value
        persist(name, value) if persist
      end

      def persist(_name, content_string)
        raise 'Can only persist String data types' unless content_string.is_a?(String)
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
puppetfile-resolver-0.6.3 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.6.2 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.6.1 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.6.0 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.5.0 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.4.0 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.3.0 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.2.0 lib/puppetfile-resolver/cache/base.rb
puppetfile-resolver-0.1.0 lib/puppetfile-resolver/cache/base.rb