Sha256: 6e558f4343545234773bba70edec08879425269b1b2960eb750fc36a449b8865

Contents?: true

Size: 341 Bytes

Versions: 3

Compression:

Stored size: 341 Bytes

Contents

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

3 entries across 3 versions & 1 rubygems

Version Path
ecb_exchange-0.1.2 lib/ecb/exchange/memory_cache.rb
ecb_exchange-0.1.1 lib/ecb/exchange/memory_cache.rb
ecb_exchange-0.1.0 lib/ecb/exchange/memory_cache.rb