Parent

Rack::Attack::StoreProxy::RedisStoreProxy

Public Class Methods

new(store) click to toggle source
# File lib/rack/attack/store_proxy.rb, line 23
def initialize(store)
  super(store)
end

Public Instance Methods

increment(key, amount, options={}) click to toggle source
# File lib/rack/attack/store_proxy.rb, line 39
def increment(key, amount, options={})
  count = nil
  self.pipelined do
    count = self.incrby(key, amount)
    self.expire(key, options[:expires_in]) if options[:expires_in]
  end
  count.value if count
end
read(key) click to toggle source
# File lib/rack/attack/store_proxy.rb, line 27
def read(key)
  self.get(key)
end
write(key, value, options={}) click to toggle source
# File lib/rack/attack/store_proxy.rb, line 31
def write(key, value, options={})
  if (expires_in = options[:expires_in])
    self.setex(key, expires_in, value)
  else
    self.set(key, value)
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.