0

I don't know why I get this error. Both methods are corrects.

hydra = Typhoeus::Hydra.new

             hydra.cache_getter do |request|
                Rails.cache.read(request.cache_key) rescue nil
             end
             hydra.cache_setter do |request|
               Rails.cache.write(request.cache_key,request.response, expires_in: request.cache_timeout)
             end

ruby 1.9.2p320 (2012-04-20 revision 35421) [x86_64-darwin11.4.2]

Rails 3.2.8

sparkle
  • 7,530
  • 22
  • 69
  • 131

1 Answers1

1

You are getting that error because those methods do not exist on an instance of Typhoeus::Hydra. You can find the full list of available methods at http://rubydoc.info/gems/typhoeus/0.5.0/frames

Update

Those methods were removed between versions 0.4.2 and 0.5.0 via this commit

Peter Brown
  • 50,956
  • 18
  • 113
  • 146
  • Ok, thanks, So there are no more cache system in Typhoeus now? – sparkle Nov 02 '12 at 22:37
  • Good question, I haven't done anything with caching in Typhoeus. I'd recommend contacting the author and see what's up. Unfortunately that commit message sucks :( – Peter Brown Nov 02 '12 at 22:48
  • typhoeus has caching facilities build in. when i got it correctly, they just changed the interface for the getter and setter methods and wrap it in a class. see: https://github.com/typhoeus/typhoeus#caching – Mario David Jun 17 '13 at 12:29