Module: Moneta::HashAdapter Private
- Included in:
- Adapters::LocalMemCache, Adapters::Memory, Adapters::TokyoTyrant
- Defined in:
- lib/moneta/mixins.rb
This module is part of a private API. You should avoid using this module if possible, as it may be removed or be changed in the future.
Instance Attribute Summary collapse
- #backend ⇒ Object readonly private
Instance Method Summary collapse
-
#clear(options = {}) ⇒ void
Clear all keys in this store.
-
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value.
-
#key?(key, options = {}) ⇒ Boolean
Exists the value with key.
-
#load(key, options = {}) ⇒ Object
Fetch value with key.
-
#store(key, value, options = {}) ⇒ Object
Store value with key.
Instance Attribute Details
#backend ⇒ Object (readonly)
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
258 259 260 |
# File 'lib/moneta/mixins.rb', line 258 def backend @backend end |
Instance Method Details
#clear(options = {}) ⇒ void
This method returns an undefined value.
Clear all keys in this store
281 282 283 284 |
# File 'lib/moneta/mixins.rb', line 281 def clear( = {}) @backend.clear self end |
#delete(key, options = {}) ⇒ Object
Delete the key from the store and return the current value
276 277 278 |
# File 'lib/moneta/mixins.rb', line 276 def delete(key, = {}) @backend.delete(key) end |
#key?(key, options = {}) ⇒ Boolean
Exists the value with key
261 262 263 |
# File 'lib/moneta/mixins.rb', line 261 def key?(key, = {}) @backend.has_key?(key) end |
#load(key, options = {}) ⇒ Object
Fetch value with key. Return nil if the key doesn’t exist
266 267 268 |
# File 'lib/moneta/mixins.rb', line 266 def load(key, = {}) @backend[key] end |
#store(key, value, options = {}) ⇒ Object
Store value with key
271 272 273 |
# File 'lib/moneta/mixins.rb', line 271 def store(key, value, = {}) @backend[key] = value end |