Sha256: d94250ab3995151f76e4be3edd02dfeb132783d35fd7f7bb1c16c3f89dad4415

Contents?: true

Size: 415 Bytes

Versions: 8

Compression:

Stored size: 415 Bytes

Contents

module Socrates
  module Storage
    class Memory
      def initialize
        @memory = {}
      end

      def has_key?(key)
        @memory.has_key?(key)
      end

      def clear(key)
        @memory.delete(key)
      end

      def get(key)
        @memory[key]
      end

      def put(key, value)
        @memory[key] = value
      end

      def clear_all
        @memory.clear
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
socrates-0.1.18 lib/socrates/storage/memory.rb
socrates-0.1.17 lib/socrates/storage/memory.rb
socrates-0.1.16 lib/socrates/storage/memory.rb
socrates-0.1.15 lib/socrates/storage/memory.rb
socrates-0.1.14 lib/socrates/storage/memory.rb
socrates-0.1.13 lib/socrates/storage/memory.rb
socrates-0.1.12 lib/socrates/storage/memory.rb
socrates-0.1.11 lib/socrates/storage/memory.rb