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.
- #message ⇒ Object
- #retry_after ⇒ Object
Constructor Details
#initialize(response) ⇒ TooManyRequestsError
Returns a new instance of TooManyRequestsError.
9 10 11 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 9 def initialize(response) @response = response 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
#message ⇒ Object
13 14 15 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 13 def "Retry after #{retry_after} seconds" end |
#retry_after ⇒ Object
17 18 19 |
# File 'lib/slack/web/api/errors/too_many_requests_error.rb', line 17 def retry_after response.headers['retry-after'].to_i end |