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.



7
8
9
# File 'lib/scripter/cache_store.rb', line 7

def initialize
  @cache = defined?(Rails) ? Rails.cache : ActiveSupport::Cache.lookup_store(:file_store, 'tmp/cache')
end

Instance Method Details

#read(*args) ⇒ Object



11
12
13
# File 'lib/scripter/cache_store.rb', line 11

def read(*args)
  @cache.read(*args)
end

#write(*args) ⇒ Object



15
16
17
# File 'lib/scripter/cache_store.rb', line 15

def write(*args)
  @cache.write(*args)
end