Sha256: 54f299bff1a2aa6b025f4f75ad92af39b32bf78b0a39a7703661f93d1740828b
Contents?: true
Size: 678 Bytes
Versions: 6772
Compression:
Stored size: 678 Bytes
Contents
module Typhoeus class Request module Cacheable def response=(response) cache.set(self, response) if cacheable? && !response.cached? super end def cacheable? cache end def run if response = cached_response response.cached = true finish(response) else super end end def cached_response cacheable? && cache.get(self) end def cache_ttl options[:cache_ttl] end private def cache return nil if options[:cache] === false options[:cache] || Typhoeus::Config.cache end end end end
Version data entries
6,772 entries across 6,770 versions & 23 rubygems