class Galago::RateLimiter::MemcachedCounter
Public Class Methods
new(client)
click to toggle source
# File lib/galago/rate_limiter/memcached_counter.rb, line 4 def initialize(client) @memcached = client end
Public Instance Methods
increment(key, amount, options = {})
click to toggle source
# File lib/galago/rate_limiter/memcached_counter.rb, line 8 def increment(key, amount, options = {}) @memcached.incr(key, amount, options[:expires_in], 1) end
reset!()
click to toggle source
# File lib/galago/rate_limiter/memcached_counter.rb, line 12 def reset! @memcached.flush end