class Hatchet::ShellThrottle::FakeResponse

Helper class to be used along with the PlatformAPI.rate_throttle interface that expects a response object

Example:

FakeResponse.new(status: 200, remaining: 2).status #=> 200
FakeResponse.new(status: 200, remaining: 2).headers["RateLimit-Remaining"] #=> 2

Attributes

headers[R]
status[R]

Public Class Methods

new(status:, remaining: ) click to toggle source
# File lib/hatchet/shell_throttle.rb, line 60
def initialize(status:, remaining: )
  @status = status

  @headers = {
    "RateLimit-Remaining" => remaining,
    "RateLimit-Multiplier" => 1,
    "Content-Type" => "text/plain".freeze
  }
end