Exception: Slack::TooManyRequestsError
- Defined in:
- lib/laziness/errors.rb
Instance Method Summary collapse
-
#initialize(response) ⇒ TooManyRequestsError
constructor
A new instance of TooManyRequestsError.
- #message ⇒ Object
- #retry_after_in_seconds ⇒ Object
Constructor Details
#initialize(response) ⇒ TooManyRequestsError
Returns a new instance of TooManyRequestsError.
99 100 101 |
# File 'lib/laziness/errors.rb', line 99 def initialize(response) @response = response end |
Instance Method Details
#message ⇒ Object
103 104 105 |
# File 'lib/laziness/errors.rb', line 103 def "Retry after #{retry_after_in_seconds} seconds" end |
#retry_after_in_seconds ⇒ Object
107 108 109 110 |
# File 'lib/laziness/errors.rb', line 107 def retry_after_in_seconds retry_after = response.headers["retry-after"] (retry_after || 0).to_i end |