Exception: RateLimitMockServer::RateLimitError
- Inherits:
-
StandardError
- Object
- StandardError
- RateLimitMockServer::RateLimitError
- Defined in:
- lib/rate_limit_mock_server/rate_limit_error.rb
Constant Summary collapse
- MESSAGE_TEMPLATE =
'Received requests @%0.1f rps! Max allowed: %d rps'
Instance Attribute Summary collapse
-
#limit ⇒ Object
readonly
Returns the value of attribute limit.
-
#rate ⇒ Object
readonly
Returns the value of attribute rate.
Instance Method Summary collapse
-
#initialize(rate:, limit:) ⇒ RateLimitError
constructor
A new instance of RateLimitError.
Constructor Details
#initialize(rate:, limit:) ⇒ RateLimitError
Returns a new instance of RateLimitError.
9 10 11 12 13 14 |
# File 'lib/rate_limit_mock_server/rate_limit_error.rb', line 9 def initialize(rate:, limit:) @rate = rate @limit = limit super format(MESSAGE_TEMPLATE, rate, limit) end |
Instance Attribute Details
#limit ⇒ Object (readonly)
Returns the value of attribute limit.
7 8 9 |
# File 'lib/rate_limit_mock_server/rate_limit_error.rb', line 7 def limit @limit end |
#rate ⇒ Object (readonly)
Returns the value of attribute rate.
7 8 9 |
# File 'lib/rate_limit_mock_server/rate_limit_error.rb', line 7 def rate @rate end |