class RateLimit::Memory
Public Class Methods
new()
click to toggle source
# File lib/ratelimit/bucketbased.rb, line 82 def initialize @buckets = {} end
Public Instance Methods
get(name)
click to toggle source
retrieves a named bucket
-
Args :
-
name
-> the name of the bucket to be retrieved
-
-
Returns :
-
the bucket matching the name if found, nil otherwise
-
# File lib/ratelimit/bucketbased.rb, line 91 def get(name) @buckets[name] end
set(bucket)
click to toggle source
update(bucket)
click to toggle source
updates the key fields that need updating into the storage this is often cheaper for certain types of storage than using set()
-
Args :
-
Returns :
-
nil
-
# File lib/ratelimit/bucketbased.rb, line 110 def update(bucket) # already updated end