Class: BasicCache::NullStore
- Inherits:
-
Object
- Object
- BasicCache::NullStore
- Defined in:
- lib/basiccache/stores/nullstore.rb
Overview
No-op store object, does not store information
Instance Attribute Summary collapse
-
#raw ⇒ Object
readonly
Returns the value of attribute raw.
Instance Method Summary collapse
-
#[](_) ⇒ Object
Retrieve a key.
-
#[]=(_, value) ⇒ Object
Set a key.
-
#clear!(*_) ⇒ Object
Clears a specified key or the whole store.
-
#include?(_) ⇒ Boolean
Check for a key in the store.
-
#initialize(_ = {}) ⇒ NullStore
constructor
Generate an empty store.
-
#keys ⇒ Object
Array of keys in the store.
-
#size ⇒ Object
Return the size of the store.
Constructor Details
#initialize(_ = {}) ⇒ NullStore
Generate an empty store
10 11 12 |
# File 'lib/basiccache/stores/nullstore.rb', line 10 def initialize(_ = {}) @raw = nil end |
Instance Attribute Details
#raw ⇒ Object (readonly)
Returns the value of attribute raw.
5 6 7 |
# File 'lib/basiccache/stores/nullstore.rb', line 5 def raw @raw end |
Instance Method Details
#[](_) ⇒ Object
Retrieve a key
24 25 26 |
# File 'lib/basiccache/stores/nullstore.rb', line 24 def [](_) nil end |
#[]=(_, value) ⇒ Object
Set a key
31 32 33 |
# File 'lib/basiccache/stores/nullstore.rb', line 31 def []=(_, value) value end |
#clear!(*_) ⇒ Object
Clears a specified key or the whole store
17 18 19 |
# File 'lib/basiccache/stores/nullstore.rb', line 17 def clear!(*_) true end |
#include?(_) ⇒ Boolean
Check for a key in the store
45 46 47 |
# File 'lib/basiccache/stores/nullstore.rb', line 45 def include?(_) false end |
#keys ⇒ Object
Array of keys in the store
52 53 54 |
# File 'lib/basiccache/stores/nullstore.rb', line 52 def keys [] end |
#size ⇒ Object
Return the size of the store
38 39 40 |
# File 'lib/basiccache/stores/nullstore.rb', line 38 def size 0 end |