Sha256: b152216cf4c7c5f7bb21326b68bc82f6014893291314d09cfae327b00e88edc9

Contents?: true

Size: 302 Bytes

Versions: 20

Compression:

Stored size: 302 Bytes

Contents

module Ddr::Models
  class Cache < Hash

    def get(key)
      self[key]
    end

    def put(key, value)
      self[key] = value
    end

    def with(options, &block)
      merge!(options)
      block_result = yield
      reject! { |k, v| options.include?(k) }
      block_result
    end

  end
end

Version data entries

20 entries across 20 versions & 1 rubygems

Version Path
ddr-models-2.11.0 lib/ddr/models/cache.rb
ddr-models-2.10.2 lib/ddr/models/cache.rb
ddr-models-2.10.1 lib/ddr/models/cache.rb
ddr-models-2.10.0 lib/ddr/models/cache.rb
ddr-models-2.10.0.rc2 lib/ddr/models/cache.rb
ddr-models-2.10.0.rc1 lib/ddr/models/cache.rb
ddr-models-2.9.2 lib/ddr/models/cache.rb
ddr-models-2.9.1 lib/ddr/models/cache.rb
ddr-models-2.9.0 lib/ddr/models/cache.rb
ddr-models-2.9.0.rc1 lib/ddr/models/cache.rb
ddr-models-2.8.0 lib/ddr/models/cache.rb
ddr-models-2.8.0.rc1 lib/ddr/models/cache.rb
ddr-models-2.7.6 lib/ddr/models/cache.rb
ddr-models-2.7.5 lib/ddr/models/cache.rb
ddr-models-2.7.4 lib/ddr/models/cache.rb
ddr-models-2.7.3 lib/ddr/models/cache.rb
ddr-models-2.7.2 lib/ddr/models/cache.rb
ddr-models-2.7.1 lib/ddr/models/cache.rb
ddr-models-2.7.0 lib/ddr/models/cache.rb
ddr-models-2.7.0.rc1 lib/ddr/models/cache.rb