Skip to content

Commit

Permalink
Update based on changes to redis-rb gem v4.0.
Browse files Browse the repository at this point in the history
[] and []= methods were removed.
  • Loading branch information
alexreisner committed Mar 28, 2018
1 parent fa54d4d commit c74356b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/autoexpire_cache_redis.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ def initialize(store, ttl = 86400)
end

def [](url)
@store.[](url)
@store.get(url)
end

def []=(url, value)
@store.[]=(url, value)
@store.set(url, value)
@store.expire(url, @ttl)
end

Expand All @@ -25,4 +25,4 @@ def del(url)
end
end

Geocoder.configure(:cache => AutoexpireCacheRedis.new(Redis.new))
Geocoder.configure(:cache => AutoexpireCacheRedis.new(Redis.new))

0 comments on commit c74356b

Please sign in to comment.