Class: WechatClient::CacheStore::BaseStore
- Inherits:
-
Object
- Object
- WechatClient::CacheStore::BaseStore
- Defined in:
- lib/wechat_client/cache_store/base_store.rb
Direct Known Subclasses
Instance Method Summary collapse
-
#initialize(client) ⇒ BaseStore
constructor
A new instance of BaseStore.
- #read(key) ⇒ Object
- #write(key, json) ⇒ Object
Constructor Details
#initialize(client) ⇒ BaseStore
Returns a new instance of BaseStore.
4 5 6 |
# File 'lib/wechat_client/cache_store/base_store.rb', line 4 def initialize client @client = client end |
Instance Method Details
#read(key) ⇒ Object
13 14 15 16 |
# File 'lib/wechat_client/cache_store/base_store.rb', line 13 def read key mar_obj = cache_read(key) Marshal.load(mar_obj) end |
#write(key, json) ⇒ Object
8 9 10 11 |
# File 'lib/wechat_client/cache_store/base_store.rb', line 8 def write key, json mar_obj = Marshal.dump(json) cache_write(key, mar_obj) end |