Class: CurrencyExchange::Storage::RailsCache

Inherits:
Cache
  • Object
show all
Defined in:
lib/currency_exchange/storage/rails_cache.rb

Constant Summary

Constants inherited from Cache

Cache::CACHE_STRATEGY

Instance Method Summary collapse

Methods inherited from Cache

instance

Instance Method Details

#fetch(key) ⇒ Object



11
12
13
# File 'lib/currency_exchange/storage/rails_cache.rb', line 11

def fetch(key)
  Rails.cache.read(key)
end

#store(key, value) ⇒ Object



15
16
17
18
# File 'lib/currency_exchange/storage/rails_cache.rb', line 15

def store(key, value)
  Rails.cache.write(key, value, :expires_in => 86400)
  value
end