Class: Scripter::CacheStore
- Inherits:
-
Object
- Object
- Scripter::CacheStore
- Defined in:
- lib/scripter/cache_store.rb
Instance Method Summary collapse
-
#initialize ⇒ CacheStore
constructor
A new instance of CacheStore.
- #read(*args) ⇒ Object
- #write(*args) ⇒ Object
Constructor Details
#initialize ⇒ CacheStore
Returns a new instance of CacheStore.
6 7 8 |
# File 'lib/scripter/cache_store.rb', line 6 def initialize @cache = defined?(Rails) ? Rails.cache : ActiveSupport::Cache.lookup_store(:file_store, 'tmp/cache') end |
Instance Method Details
#read(*args) ⇒ Object
10 11 12 |
# File 'lib/scripter/cache_store.rb', line 10 def read(*args) @cache.read(*args) end |
#write(*args) ⇒ Object
14 15 16 |
# File 'lib/scripter/cache_store.rb', line 14 def write(*args) @cache.write(*args) end |