Class: RateLimit::Config
- Inherits:
-
Struct
- Object
- Struct
- RateLimit::Config
- Defined in:
- lib/ratelimit/bucketbased.rb
Overview
To set bucket parameters easily, you can create named configurations to create buckets using those templates.
The configurations have the following parameters:
name
-
the name of the configuration
start
-
the credits that a new bucket starts with
max
-
the maximum that the bucket will be filled by the regeneration process
min
-
the minimum that a bucket can go, must be <= 0.
refill_amount
-
the amount that will be added to the bucket every refill_epoch seconds.
refill_epoch
-
the number of seconds before the bucket is credited by the regeneration process
Instance Attribute Summary collapse
-
#cost ⇒ Object
Returns the value of attribute cost.
-
#max ⇒ Object
Returns the value of attribute max.
-
#min ⇒ Object
Returns the value of attribute min.
-
#name ⇒ Object
Returns the value of attribute name.
-
#refill_amount ⇒ Object
Returns the value of attribute refill_amount.
-
#refill_epoch ⇒ Object
Returns the value of attribute refill_epoch.
-
#start ⇒ Object
Returns the value of attribute start.
Instance Attribute Details
#cost ⇒ Object
Returns the value of attribute cost
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def cost @cost end |
#max ⇒ Object
Returns the value of attribute max
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def max @max end |
#min ⇒ Object
Returns the value of attribute min
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def min @min end |
#name ⇒ Object
Returns the value of attribute name
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def name @name end |
#refill_amount ⇒ Object
Returns the value of attribute refill_amount
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def refill_amount @refill_amount end |
#refill_epoch ⇒ Object
Returns the value of attribute refill_epoch
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def refill_epoch @refill_epoch end |
#start ⇒ Object
Returns the value of attribute start
27 28 29 |
# File 'lib/ratelimit/bucketbased.rb', line 27 def start @start end |