Class: SpeedLimiter::State
- Inherits:
-
Object
- Object
- SpeedLimiter::State
- Extended by:
- Forwardable
- Defined in:
- lib/speed_limiter/state.rb
Overview
Execution status model
Instance Attribute Summary collapse
-
#count ⇒ Object
readonly
Returns the value of attribute count.
-
#params ⇒ Object
readonly
Returns the value of attribute params.
-
#ttl ⇒ Object
readonly
Returns the value of attribute ttl.
Instance Method Summary collapse
- #config ⇒ Object
-
#initialize(params:, count:, ttl:) ⇒ State
constructor
A new instance of State.
- #inspect ⇒ Object (also: #to_s)
- #key ⇒ Object
- #limit ⇒ Object
- #on_throttled ⇒ Object
- #period ⇒ Object
- #retry ⇒ Object
Constructor Details
#initialize(params:, count:, ttl:) ⇒ State
Returns a new instance of State.
14 15 16 17 18 |
# File 'lib/speed_limiter/state.rb', line 14 def initialize(params:, count:, ttl:) @params = params @count = count @ttl = ttl end |
Instance Attribute Details
#count ⇒ Object (readonly)
Returns the value of attribute count.
20 21 22 |
# File 'lib/speed_limiter/state.rb', line 20 def count @count end |
#params ⇒ Object (readonly)
Returns the value of attribute params.
20 21 22 |
# File 'lib/speed_limiter/state.rb', line 20 def params @params end |
#ttl ⇒ Object (readonly)
Returns the value of attribute ttl.
20 21 22 |
# File 'lib/speed_limiter/state.rb', line 20 def ttl @ttl end |
Instance Method Details
#config ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |
#inspect ⇒ Object Also known as: to_s
36 37 38 |
# File 'lib/speed_limiter/state.rb', line 36 def inspect "<#{self.class.name} key=#{key.inspect} count=#{count} ttl=#{ttl}>" end |
#key ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |
#limit ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |
#on_throttled ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |
#period ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |
#retry ⇒ Object
34 |
# File 'lib/speed_limiter/state.rb', line 34 delegate %i[config key limit period on_throttled retry] => :@params |