Sha256: a6f5f4dbf0d2bd6ff3aa8a470106447c189c28d84eb2a3da7e4c9eea1155e3e6

Contents?: true

Size: 485 Bytes

Versions: 12

Compression:

Stored size: 485 Bytes

Contents

module Verdict
  module Storage
    class MemoryStorage < BaseStorage
      attr_reader :storage

      def initialize
        @storage = {}
      end

      def get(scope, key)
        @storage[scope] ||= {}
        @storage[scope][key]
      end

      def set(scope, key, value)
        @storage[scope] ||= {}
        @storage[scope][key] = value
      end

      def remove(scope, key)
        @storage[scope] ||= {}
        @storage[scope].delete(key)
      end
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
verdict-0.11.0 lib/verdict/storage/memory_storage.rb
verdict-0.10.0 lib/verdict/storage/memory_storage.rb
verdict-0.9.0 lib/verdict/storage/memory_storage.rb
verdict-0.8.0 lib/verdict/storage/memory_storage.rb
verdict-0.7.0 lib/verdict/storage/memory_storage.rb
verdict-0.6.3 lib/verdict/storage/memory_storage.rb
verdict-0.6.2 lib/verdict/storage/memory_storage.rb
verdict-0.6.1 lib/verdict/storage/memory_storage.rb
verdict-0.6.0 lib/verdict/storage/memory_storage.rb
verdict-0.5.0 lib/verdict/storage/memory_storage.rb
verdict-0.4.1 lib/verdict/storage/memory_storage.rb
verdict-0.4.0 lib/verdict/storage/memory_storage.rb