ministryofjustice/Claim-for-Crown-Court-Defence

View on GitHub
lib/caching/memory_store.rb

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
require_relative 'abstract_store'

class Caching
  class MemoryStore < AbstractStore
    delegate :clear, to: :store

    def initialize
      self.store = {}
    end

    def self.current
      self.instance ||= new
    end

    def get(key)
      store[key]
    end

    def set(key, value)
      store[key] = value
    end
  end
end