Class: TyphoeusCache

Inherits:
CacheFileStore show all
Defined in:
lib/common/typhoeus_cache.rb

Instance Attribute Summary

Attributes inherited from CacheFileStore

#cache_dir, #serializer, #storage_path

Instance Method Summary collapse

Methods inherited from CacheFileStore

#clean, #get_entry_file_path, #initialize, #read_entry, #storage_dir, #write_entry

Constructor Details

This class inherits a constructor from CacheFileStore

Instance Method Details

#get(request) ⇒ Object


7
8
9
# File 'lib/common/typhoeus_cache.rb', line 7

def get(request)
  read_entry(request.hash.to_s)
end

#set(request, response) ⇒ Object


11
12
13
# File 'lib/common/typhoeus_cache.rb', line 11

def set(request, response)
  write_entry(request.hash.to_s, response, request.cache_ttl)
end