Class: Slack::Web::Api::Errors::TooManyRequestsError
- Inherits:
-
Faraday::Error
- Object
- Faraday::Error
- Slack::Web::Api::Errors::TooManyRequestsError
- Defined in:
- lib/slack/web/api/errors/too_many_requests_error.rb
Instance Attribute Summary collapse
-
#response ⇒ Object
readonly
Returns the value of attribute response.
Instance Method Summary collapse
-
#initialize(response) ⇒ TooManyRequestsError
constructor
A new instance of TooManyRequestsError.
- #retry_after ⇒ Object
Constructor Details
#initialize(response) ⇒ TooManyRequestsError
Returns a new instance of TooManyRequestsError.
9 10 11 12 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 9 def initialize(response) @response = response super "Retry after #{retry_after} seconds" end |
Instance Attribute Details
#response ⇒ Object (readonly)
Returns the value of attribute response.
7 8 9 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 7 def response @response end |
Instance Method Details
#retry_after ⇒ Object
14 15 16 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 14 def retry_after response.headers['retry-after'].to_i end |