Class: Blix::Rest::Cache
- Inherits:
-
Object
- Object
- Blix::Rest::Cache
- Defined in:
- lib/blix/rest/cache.rb
Overview
cache server responses
Direct Known Subclasses
Instance Attribute Summary collapse
-
#params ⇒ Object
readonly
Returns the value of attribute params.
Instance Method Summary collapse
- #[](key) ⇒ Object
- #[]=(key, data) ⇒ Object
-
#clear ⇒ Object
clear all data from the cache.
- #delete(key) ⇒ Object
-
#get(key) ⇒ Object
retrieve data from the cache.
-
#initialize(params = {}) ⇒ Cache
constructor
A new instance of Cache.
-
#key?(key) ⇒ Boolean
is key present in the cache.
-
#set(key, data) ⇒ Object
set data in the cache.
Constructor Details
#initialize(params = {}) ⇒ Cache
Returns a new instance of Cache.
8 9 10 |
# File 'lib/blix/rest/cache.rb', line 8 def initialize(params={}) @params = params end |
Instance Attribute Details
#params ⇒ Object (readonly)
Returns the value of attribute params.
6 7 8 |
# File 'lib/blix/rest/cache.rb', line 6 def params @params end |
Instance Method Details
#[](key) ⇒ Object
12 13 14 |
# File 'lib/blix/rest/cache.rb', line 12 def [](key) get(key) end |
#[]=(key, data) ⇒ Object
16 17 18 |
# File 'lib/blix/rest/cache.rb', line 16 def []=(key,data) set(key, data) end |
#clear ⇒ Object
clear all data from the cache
23 24 25 |
# File 'lib/blix/rest/cache.rb', line 23 def clear end |
#delete(key) ⇒ Object
42 43 44 |
# File 'lib/blix/rest/cache.rb', line 42 def delete(key) end |
#get(key) ⇒ Object
retrieve data from the cache
28 29 30 |
# File 'lib/blix/rest/cache.rb', line 28 def get(key) end |
#key?(key) ⇒ Boolean
is key present in the cache
38 39 40 |
# File 'lib/blix/rest/cache.rb', line 38 def key?(key) end |
#set(key, data) ⇒ Object
set data in the cache
33 34 35 |
# File 'lib/blix/rest/cache.rb', line 33 def set(key, data) end |