Sha256: 883038cd18acfe8b15cf0cfbb5115f7517738db7c29a7a79045a671318d8ffff

Contents?: true

Size: 493 Bytes

Versions: 8

Compression:

Stored size: 493 Bytes

Contents

require "socrates/storage/storage"

module Socrates
  module Storage
    class Memory
      include Socrates::Storage::Storage

      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.26 lib/socrates/storage/memory.rb
socrates-0.1.25 lib/socrates/storage/memory.rb
socrates-0.1.24 lib/socrates/storage/memory.rb
socrates-0.1.23 lib/socrates/storage/memory.rb
socrates-0.1.22 lib/socrates/storage/memory.rb
socrates-0.1.21 lib/socrates/storage/memory.rb
socrates-0.1.20 lib/socrates/storage/memory.rb
socrates-0.1.19 lib/socrates/storage/memory.rb