Class: Spikard::RateLimitConfig
- Inherits:
-
Object
- Object
- Spikard::RateLimitConfig
- Defined in:
- lib/spikard/config.rb
Overview
Rate limiting configuration using Generic Cell Rate Algorithm (GCRA).
By default, rate limits are applied per IP address.
Instance Attribute Summary collapse
-
#burst ⇒ Object
Returns the value of attribute burst.
-
#ip_based ⇒ Object
Returns the value of attribute ip_based.
-
#per_second ⇒ Object
Returns the value of attribute per_second.
Instance Method Summary collapse
-
#initialize(per_second:, burst:, ip_based: true) ⇒ RateLimitConfig
constructor
A new instance of RateLimitConfig.
Constructor Details
#initialize(per_second:, burst:, ip_based: true) ⇒ RateLimitConfig
Returns a new instance of RateLimitConfig.
47 48 49 50 51 |
# File 'lib/spikard/config.rb', line 47 def initialize(per_second:, burst:, ip_based: true) @per_second = per_second @burst = burst @ip_based = ip_based end |
Instance Attribute Details
#burst ⇒ Object
Returns the value of attribute burst.
42 43 44 |
# File 'lib/spikard/config.rb', line 42 def burst @burst end |
#ip_based ⇒ Object
Returns the value of attribute ip_based.
42 43 44 |
# File 'lib/spikard/config.rb', line 42 def ip_based @ip_based end |
#per_second ⇒ Object
Returns the value of attribute per_second.
42 43 44 |
# File 'lib/spikard/config.rb', line 42 def per_second @per_second end |