Module: Cache::ActiveSupportCacheStore
- Defined in:
- lib/cache/active_support_cache_store.rb
Instance Method Summary collapse
- #_delete(k) ⇒ Object
- #_exist?(k) ⇒ Boolean
- #_fetch(k, ttl, &blk) ⇒ Object
- #_flush ⇒ Object
- #_get(k) ⇒ Object
- #_get_multi(ks) ⇒ Object
- #_set(k, v, ttl) ⇒ Object
Instance Method Details
#_delete(k) ⇒ Object
26 27 28 |
# File 'lib/cache/active_support_cache_store.rb', line 26 def _delete(k) @metal.delete k end |
#_exist?(k) ⇒ Boolean
34 35 36 |
# File 'lib/cache/active_support_cache_store.rb', line 34 def _exist?(k) @metal.exist? k end |
#_fetch(k, ttl, &blk) ⇒ Object
18 19 20 21 22 23 24 |
# File 'lib/cache/active_support_cache_store.rb', line 18 def _fetch(k, ttl, &blk) if _valid_ttl?(ttl) @metal.fetch k, { :expires_in => ttl }, &blk else @metal.fetch k, &blk end end |
#_flush ⇒ Object
30 31 32 |
# File 'lib/cache/active_support_cache_store.rb', line 30 def _flush @metal.clear end |
#_get(k) ⇒ Object
2 3 4 |
# File 'lib/cache/active_support_cache_store.rb', line 2 def _get(k) @metal.read k end |
#_get_multi(ks) ⇒ Object
6 7 8 |
# File 'lib/cache/active_support_cache_store.rb', line 6 def _get_multi(ks) @metal.read_multi *ks end |
#_set(k, v, ttl) ⇒ Object
10 11 12 13 14 15 16 |
# File 'lib/cache/active_support_cache_store.rb', line 10 def _set(k, v, ttl) if _valid_ttl?(ttl) @metal.write k, v, :expires_in => ttl else @metal.write k, v end end |