Class: Socrates::Storage::MemoryStorage

Inherits:
Object
  • Object
show all
Defined in:
lib/socrates/storage/storage.rb

Instance Method Summary collapse

Constructor Details

#initializeMemoryStorage



7
8
9
# File 'lib/socrates/storage/storage.rb', line 7

def initialize
  @storage = {}
end

Instance Method Details

#clear(key) ⇒ Object



15
16
17
# File 'lib/socrates/storage/storage.rb', line 15

def clear(key)
  @storage.delete key
end

#get(key) ⇒ Object



19
20
21
# File 'lib/socrates/storage/storage.rb', line 19

def get(key)
  @storage[key]
end

#has_key?(key) ⇒ Boolean



11
12
13
# File 'lib/socrates/storage/storage.rb', line 11

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

#put(key, value) ⇒ Object



23
24
25
# File 'lib/socrates/storage/storage.rb', line 23

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