Module: ZkCache
- Defined in:
- lib/zk_client/zk_cache.rb
Class Method Summary collapse
- .all ⇒ Object
- .cache(key, value) ⇒ Object
- .destroy_cache ⇒ Object
- .load_cache ⇒ Object
- .read(key) ⇒ Object
- .root_path ⇒ Object
- .to_s ⇒ Object
Class Method Details
.all ⇒ Object
34 35 36 |
# File 'lib/zk_client/zk_cache.rb', line 34 def all _cache end |
.cache(key, value) ⇒ Object
7 8 9 10 |
# File 'lib/zk_client/zk_cache.rb', line 7 def cache(key, value) path = _process_path(key) _cache[path] = value end |
.destroy_cache ⇒ Object
22 23 24 |
# File 'lib/zk_client/zk_cache.rb', line 22 def destroy_cache @@cache = {} end |
.load_cache ⇒ Object
17 18 19 20 |
# File 'lib/zk_client/zk_cache.rb', line 17 def load_cache _load_cache(ZkClient.root_path) self.to_s end |
.read(key) ⇒ Object
12 13 14 15 |
# File 'lib/zk_client/zk_cache.rb', line 12 def read(key) path = _process_path(key) _cache[path] end |
.root_path ⇒ Object
30 31 32 |
# File 'lib/zk_client/zk_cache.rb', line 30 def root_path ZkClient.root_path end |
.to_s ⇒ Object
26 27 28 |
# File 'lib/zk_client/zk_cache.rb', line 26 def to_s _cache.to_json end |