Exception: Redd::Errors::RateLimitError

Inherits:
APIError
  • Object
show all
Defined in:
lib/redd/errors.rb

Overview

Indicates that you were rate limited. This should be taken care of automatically.

Instance Attribute Summary collapse

Attributes inherited from APIError

#name, #response

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ RateLimitError

Returns a new instance of RateLimitError.


23
24
25
26
# File 'lib/redd/errors.rb', line 23

def initialize(response)
  super(response)
  @duration = response.body[:json][:ratelimit]
end

Instance Attribute Details

#durationObject (readonly)

Returns the value of attribute duration


21
22
23
# File 'lib/redd/errors.rb', line 21

def duration
  @duration
end