class KeyValueTree::MemoryStore
Public Class Methods
new(hash={})
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 5 def initialize(hash={}) @hash = hash end
Public Instance Methods
delete(key)
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 17 def delete(key) @hash.delete(key.to_s) end
key(key)
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 9 def key(key) @hash[key.to_s] end
keys()
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 21 def keys @hash.keys end
store(key, value)
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 13 def store(key, value) @hash[key.to_s] = value end
to_hash()
click to toggle source
# File lib/keyvaluetree/memory_store.rb, line 25 def to_hash @hash end