Exception: HCl::TimesheetResource::ThrottleFailure

Inherits:
StandardError
  • Object
show all
Defined in:
lib/hcl/timesheet_resource.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(response) ⇒ ThrottleFailure

Returns a new instance of ThrottleFailure.



11
12
13
14
# File 'lib/hcl/timesheet_resource.rb', line 11

def initialize response
  @retry_after = response.headers['Retry-After'].to_i
  super "Too many requests! Try again in #{@retry_after} seconds."
end

Instance Attribute Details

#retry_afterObject (readonly)

Returns the value of attribute retry_after.



10
11
12
# File 'lib/hcl/timesheet_resource.rb', line 10

def retry_after
  @retry_after
end