Module: Typhoeus::Request::Cacheable
- Included in:
- Typhoeus::Request
- Defined in:
- lib/typhoeus/request/cacheable.rb
Overview
Instance Method Summary collapse
Instance Method Details
#cache_ttl ⇒ Object
21 22 23 |
# File 'lib/typhoeus/request/cacheable.rb', line 21 def cache_ttl [:cache_ttl] end |
#cacheable? ⇒ Boolean
9 10 11 |
# File 'lib/typhoeus/request/cacheable.rb', line 9 def cacheable? Typhoeus::Config.cache end |
#response=(response) ⇒ Object
4 5 6 7 |
# File 'lib/typhoeus/request/cacheable.rb', line 4 def response=(response) Typhoeus::Config.cache.set(self, response) if cacheable? super end |
#run ⇒ Object
13 14 15 16 17 18 19 |
# File 'lib/typhoeus/request/cacheable.rb', line 13 def run if cacheable? && response = Typhoeus::Config.cache.get(self) finish(response) else super end end |