Class: ScreenshotScout::BinaryCaptureResponse

Inherits:
CaptureResponse show all
Defined in:
lib/screenshotscout/responses.rb,
sig/screenshotscout.rbs

Overview

Successful binary capture, including response metadata and image/PDF bytes.

Instance Attribute Summary collapse

Attributes inherited from CaptureResponse

#raw_response

Instance Method Summary collapse

Constructor Details

#initialize(raw_response:, screenshot_url:, screenshot_url_expires_at:, cache_status:) ⇒ BinaryCaptureResponse

Returns a new instance of BinaryCaptureResponse.



50
51
52
53
54
55
56
57
# File 'lib/screenshotscout/responses.rb', line 50

def initialize(raw_response:, screenshot_url:, screenshot_url_expires_at:, cache_status:)
  super(raw_response: raw_response)
  @bytes = raw_response.body
  @screenshot_url = screenshot_url
  @screenshot_url_expires_at = screenshot_url_expires_at
  @cache_status = cache_status
  freeze
end

Instance Attribute Details

#bytesString (readonly)

Returns the value of attribute bytes.

Returns:

  • (String)


48
49
50
# File 'lib/screenshotscout/responses.rb', line 48

def bytes
  @bytes
end

#cache_statusString? (readonly)

Returns the value of attribute cache_status.

Returns:

  • (String, nil)


48
49
50
# File 'lib/screenshotscout/responses.rb', line 48

def cache_status
  @cache_status
end

#screenshot_urlString? (readonly)

Returns the value of attribute screenshot_url.

Returns:

  • (String, nil)


48
49
50
# File 'lib/screenshotscout/responses.rb', line 48

def screenshot_url
  @screenshot_url
end

#screenshot_url_expires_atString? (readonly)

Returns the value of attribute screenshot_url_expires_at.

Returns:

  • (String, nil)


48
49
50
# File 'lib/screenshotscout/responses.rb', line 48

def screenshot_url_expires_at
  @screenshot_url_expires_at
end