Exception: Latitude::RateLimitError
- Defined in:
- lib/latitude/api/errors.rb
Instance Attribute Summary
Attributes inherited from APIError
#entries, #http_body, #http_headers, #http_status, #json_body, #request_id
Instance Method Summary collapse
Methods inherited from APIError
#code, #detail, #initialize, #title
Constructor Details
This class inherits a constructor from Latitude::APIError
Instance Method Details
#retry_after ⇒ Object
104 105 106 107 108 109 110 111 112 |
# File 'lib/latitude/api/errors.rb', line 104 def retry_after = entries.map { |e| e.["retry_after"] }.compact.first return Integer() if header_value = http_headers["retry-after"] || http_headers["Retry-After"] return Integer(header_value) if header_value && header_value.to_s.match?(/\A\d+\z/) nil end |