class Grape::Attack::Adapters::Memory

Attributes

data[R]

Public Class Methods

new() click to toggle source
# File lib/grape/attack/adapters/memory.rb, line 8
def initialize
  @data = {}
end

Public Instance Methods

atomically(&block) click to toggle source
# File lib/grape/attack/adapters/memory.rb, line 24
def atomically(&block)
  block.call
end
expire(key, ttl_in_seconds) click to toggle source
# File lib/grape/attack/adapters/memory.rb, line 21
def expire(key, ttl_in_seconds)
end
get(key) click to toggle source
# File lib/grape/attack/adapters/memory.rb, line 12
def get(key)
  data[key]
end
incr(key) click to toggle source
# File lib/grape/attack/adapters/memory.rb, line 16
def incr(key)
  data[key] ||= 0
  data[key] += 1
end