Class: RateLimitMockServer::Server
- Inherits:
-
Sinatra::Base
- Object
- Sinatra::Base
- RateLimitMockServer::Server
- Defined in:
- lib/rate_limit_mock_server/server.rb
Constant Summary collapse
- DEFAULT_RPS_LIMIT =
4
Instance Method Summary collapse
Instance Method Details
#counter ⇒ Object
39 40 41 |
# File 'lib/rate_limit_mock_server/server.rb', line 39 def counter Counter.for(request.path_info, rps_limit) end |
#rps_limit ⇒ Object
35 36 37 |
# File 'lib/rate_limit_mock_server/server.rb', line 35 def rps_limit params['captures']&.first&.to_i || DEFAULT_RPS_LIMIT end |
#user_agent ⇒ Object
43 44 45 |
# File 'lib/rate_limit_mock_server/server.rb', line 43 def user_agent request.env['HTTP_USER_AGENT'] end |