Class: SpeedLimiter::State

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/speed_limiter/state.rb

Overview

Execution status model

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(params:, count:, ttl:) ⇒ State

Returns a new instance of State.



11
12
13
14
15
# File 'lib/speed_limiter/state.rb', line 11

def initialize(params:, count:, ttl:)
  @params = params
  @count = count
  @ttl = ttl
end

Instance Attribute Details

#countObject (readonly)

Returns the value of attribute count.



17
18
19
# File 'lib/speed_limiter/state.rb', line 17

def count
  @count
end

#paramsObject (readonly)

Returns the value of attribute params.



17
18
19
# File 'lib/speed_limiter/state.rb', line 17

def params
  @params
end

#ttlObject (readonly)

Returns the value of attribute ttl.



17
18
19
# File 'lib/speed_limiter/state.rb', line 17

def ttl
  @ttl
end

Instance Method Details

#inspectObject Also known as: to_s



21
22
23
# File 'lib/speed_limiter/state.rb', line 21

def inspect
  "<#{self.class.name} key=#{key.inspect} count=#{count} ttl=#{ttl}>"
end