Sha256: aabde93b330bf45b3bcfa520a39bd9b3e3ace08a61313e25698fc2b7b8eca507

Contents?: true

Size: 372 Bytes

Versions: 2

Compression:

Stored size: 372 Bytes

Contents

# frozen_string_literal: true

module ECB
  module Exchange
    class MemoryCache
      def self.cache
        @cache ||= new
      end

      def initialize
        @store = {}
      end

      def read(key)
        @store[key]
      end

      def write(key, value)
        @store[key] = value
      end

      def clear
        @store.clear
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ecb_exchange-0.2.1 lib/ecb/exchange/memory_cache.rb
ecb_exchange-0.2.0 lib/ecb/exchange/memory_cache.rb