Sha256: 21aae9e8c34e7e71c704e6a42e256a27df8964442ee94960dd88ecea97c6c65c
Contents?: true
Size: 617 Bytes
Versions: 13
Compression:
Stored size: 617 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 cacheable? && response = cache.get(self) response.cached = true finish(response) else super end 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
13 entries across 12 versions & 4 rubygems