# File lib/typhoeus/request/cacheable.rb, line 22 def cache_ttl options[:cache_ttl] end
# File lib/typhoeus/request/cacheable.rb, line 9 def cacheable? Typhoeus::Config.cache end
# File lib/typhoeus/request/cacheable.rb, line 4 def response=(response) Typhoeus::Config.cache.set(self, response) if cacheable? && !response.cached? super end
# File lib/typhoeus/request/cacheable.rb, line 13 def run if cacheable? && response = Typhoeus::Config.cache.get(self) response.cached = true finish(response) else super end end