Exception: Redd::Error::RateLimited
- Inherits:
-
Redd::Error
- Object
- StandardError
- Redd::Error
- Redd::Error::RateLimited
- Defined in:
- lib/redd/error.rb
Overview
Raised when the client needs to wait before making another request
Direct Known Subclasses
Constant Summary
Constants inherited from Redd::Error
Archived, AuthenticationRequired, BadGateway, BadRequest, Conflict, ExpiredCode, InternalServerError, InvalidCaptcha, InvalidClassName, InvalidCredentials, InvalidGrantType, InvalidMultiredditName, InvalidOAuth2Credentials, InvalidRequest, InvalidResponseType, InvalidScope, JSONError, NoTokenGiven, NotFound, OAuth2AccessDenied, PermissionDenied, RequestError, ServiceUnavailable, TimedOut, TooManyClassNames
Instance Attribute Summary collapse
-
#time ⇒ Integer
readonly
The seconds to wait before making another request.
Attributes inherited from Redd::Error
Instance Method Summary collapse
-
#initialize(env) ⇒ RateLimited
constructor
A new instance of RateLimited.
Methods inherited from Redd::Error
Constructor Details
#initialize(env) ⇒ RateLimited
Returns a new instance of RateLimited.
127 128 129 130 |
# File 'lib/redd/error.rb', line 127 def initialize(env) super @time = env[:body][:json][:ratelimit] || 3600 end |
Instance Attribute Details
#time ⇒ Integer (readonly)
Returns the seconds to wait before making another request.
125 126 127 |
# File 'lib/redd/error.rb', line 125 def time @time end |