module Typhoeus::Request::Cacheable

Public Instance Methods

cache_ttl() click to toggle source
# File lib/typhoeus/request/cacheable.rb, line 21
def cache_ttl
  options[:cache_ttl]
end
cacheable?() click to toggle source
# File lib/typhoeus/request/cacheable.rb, line 9
def cacheable?
  Typhoeus::Config.cache
end
response=(response) click to toggle source
Calls superclass method
# File lib/typhoeus/request/cacheable.rb, line 4
def response=(response)
  Typhoeus::Config.cache.set(self, response) if cacheable?
  super
end
run() click to toggle source
Calls superclass method
# File lib/typhoeus/request/cacheable.rb, line 13
def run
  if cacheable? && response = Typhoeus::Config.cache.get(self)
    finish(response)
  else
    super
  end
end