Class: KeyValueTree::Store
- Inherits:
-
Object
- Object
- KeyValueTree::Store
show all
- Defined in:
- lib/keyvaluetree/store.rb
Instance Method Summary
collapse
Constructor Details
#initialize(hash = {}) ⇒ Store
Returns a new instance of Store.
5
6
7
|
# File 'lib/keyvaluetree/store.rb', line 5
def initialize(hash={})
raise NotImplementedError
end
|
Instance Method Details
#basic_delete(key) ⇒ Object
17
18
19
|
# File 'lib/keyvaluetree/store.rb', line 17
def basic_delete(key)
raise NotImplementedError
end
|
#delete(key) ⇒ Object
29
30
31
|
# File 'lib/keyvaluetree/store.rb', line 29
def delete(key)
self.delete_keys_start_with(key.to_s)
end
|
#delete_keys_start_with(key) ⇒ Object
33
34
35
36
37
|
# File 'lib/keyvaluetree/store.rb', line 33
def delete_keys_start_with(key)
keys_starting_with(key.to_s).each do |each|
self.basic_delete(each)
end
end
|
#key(key) ⇒ Object
9
10
11
|
# File 'lib/keyvaluetree/store.rb', line 9
def key(key)
raise NotImplementedError
end
|
#keys ⇒ Object
21
22
23
|
# File 'lib/keyvaluetree/store.rb', line 21
def keys
raise NotImplementedError
end
|
#keys_starting_with(key) ⇒ Object
39
40
41
42
43
|
# File 'lib/keyvaluetree/store.rb', line 39
def keys_starting_with(key)
self.keys.select do |sub_key|
sub_key.start_with?(key.to_s)
end
end
|
#store(key, value) ⇒ Object
13
14
15
|
# File 'lib/keyvaluetree/store.rb', line 13
def store(key, value)
raise NotImplementedError
end
|
#to_hash ⇒ Object
25
26
27
|
# File 'lib/keyvaluetree/store.rb', line 25
def to_hash
raise NotImplementedError
end
|