Class: RateLimit::Storage
- Inherits:
-
Object
- Object
- RateLimit::Storage
- Defined in:
- lib/ratelimit/bucketbased.rb
Overview
-
Returns :
-
a Bucket
-
-
Raises :
-
ArgumentError
-> if any value is nil or negative
-
Instance Method Summary collapse
-
#get(name) ⇒ Object
retrieves a named bucket * Args : -
name
-> the name of the bucket to be retrieved * Returns : - the bucket matching the name if found, nil otherwise * Raises : -NoMethodError
-> always, because this class is a jerk. -
#set(bucket) ⇒ Object
saves a bucket into the storage * Args : -
bucket
-> the Bucket to set. -
#update(bucket) ⇒ Object
updates the key fields that need updating into the storage this is often cheaper for certain types of storage than using set() * Args : -
bucket
-> the Bucket to update.
Instance Method Details
#get(name) ⇒ Object
retrieves a named bucket
-
Args :
-
name
-> the name of the bucket to be retrieved
-
-
Returns :
-
the bucket matching the name if found, nil otherwise
-
-
Raises :
-
NoMethodError
-> always, because this class is a jerk
-
53 54 55 |
# File 'lib/ratelimit/bucketbased.rb', line 53 def get(name) raise NoMethodError end |
#set(bucket) ⇒ Object
saves a bucket into the storage
-
Args :
-
bucket
-> the Bucket to set. Thename
field in the Bucket option will be used as a key.
-
-
Returns :
-
nil
-
-
Raises :
-
NoMethodError
-> always, because this class is a jerk
-
64 65 66 |
# File 'lib/ratelimit/bucketbased.rb', line 64 def set(bucket) raise NoMethodError end |
#update(bucket) ⇒ Object
updates the key fields that need updating into the storage this is often cheaper for certain types of storage than using set()
-
Args :
-
bucket
-> the Bucket to update. Thename
field in the Bucket option will be used as a key.
-
-
Returns :
-
nil
-
-
Raises :
-
NoMethodError
-> always, because this class is a jerk
-
76 77 78 |
# File 'lib/ratelimit/bucketbased.rb', line 76 def update(bucket) raise NoMethodError end |