Class: Scripter::CacheStore

Inherits:
Object
  • Object
show all
Defined in:
lib/scripter/cache_store.rb

Instance Method Summary collapse

Constructor Details

#initializeCacheStore

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