Class: Fushin::Cache
- Inherits:
-
Object
- Object
- Fushin::Cache
- Defined in:
- lib/fushin/cache.rb
Instance Attribute Summary collapse
-
#cache ⇒ Object
readonly
Returns the value of attribute cache.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Cache
constructor
A new instance of Cache.
Constructor Details
#initialize ⇒ Cache
Returns a new instance of Cache.
8 9 10 |
# File 'lib/fushin/cache.rb', line 8 def initialize @cache = Lightly.new(dir: "/tmp/fushin", life: "48h") end |
Instance Attribute Details
#cache ⇒ Object (readonly)
Returns the value of attribute cache.
7 8 9 |
# File 'lib/fushin/cache.rb', line 7 def cache @cache end |
Class Method Details
.cached?(key) ⇒ Boolean
20 21 22 |
# File 'lib/fushin/cache.rb', line 20 def self.cached?(key) new.cache.cached? key end |
.get(key) ⇒ Object
12 13 14 |
# File 'lib/fushin/cache.rb', line 12 def self.get(key) new.cache.get key end |
.save(key, value) ⇒ Object
16 17 18 |
# File 'lib/fushin/cache.rb', line 16 def self.save(key, value) new.cache.save(key, value) end |