Class: KeyValueTree::Store
- Inherits:
-
Object
- Object
- KeyValueTree::Store
- Defined in:
- lib/keyvaluetree/store.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#delete(key) ⇒ Object
5 6 7 |
# File 'lib/keyvaluetree/store.rb', line 5 def delete(key) self.delete_keys_start_with(key.to_s) end |
#delete_keys_start_with(key) ⇒ Object
9 10 11 12 13 |
# File 'lib/keyvaluetree/store.rb', line 9 def delete_keys_start_with(key) keys_starting_with(key.to_s).each do |each| self.basic_delete(each) end end |
#keys_starting_with(key) ⇒ Object
15 16 17 18 19 |
# File 'lib/keyvaluetree/store.rb', line 15 def keys_starting_with(key) self.keys.select do |sub_key| sub_key.start_with?(key.to_s) end end |