Sha256: 3723063e8b1a018ba60a164d63893c6225cb1b054e05d34848bcd7e8f98dc599

Contents?: true

Size: 687 Bytes

Versions: 53

Compression:

Stored size: 687 Bytes

Contents

module Locomotive::Steam
  module Adapters
    module Filesystem

      class SimpleCacheStore

        @@store = {}

        def fetch(name, options = nil, &block)
          if block_given?
            read(name) || write(name, yield)
          else
            read(name)
          end
        end

        def read(name, options = nil)
          @@store[name]
        end

        def write(name, value, options = nil)
          @@store[name] = value
        end

        def clear
          @@store.clear
        end

        def delete(name)
          @@store.delete(name)
        end

        #:nocov:
        def _store
          @@store
        end

      end

    end
  end
end

Version data entries

53 entries across 53 versions & 1 rubygems

Version Path
locomotivecms_steam-1.8.0.alpha2 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.8.0.alpha1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.7.1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.7.0 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.6.1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.6.0 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.6.0.rc1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.6.0.beta1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.3 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.2 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0.rc1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0.rc0 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0.beta3 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0.beta2 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.5.0.beta1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.4.1 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.4.0 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb
locomotivecms_steam-1.4.0.rc2 lib/locomotive/steam/adapters/filesystem/simple_cache_store.rb