Class: XTwitterScraper::Resources::Support::Attachments
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Support::Attachments
- Defined in:
- lib/x_twitter_scraper/resources/support/attachments.rb,
sig/x_twitter_scraper/resources/support/attachments.rbs
Overview
Support ticket management
Instance Method Summary collapse
-
#download(id, range: nil, request_options: {}) ⇒ StringIO
Streams an authenticated user's support image or video.
-
#initialize(client:) ⇒ Attachments
constructor
private
A new instance of Attachments.
Constructor Details
#initialize(client:) ⇒ Attachments
This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.
Returns a new instance of Attachments.
36 37 38 |
# File 'lib/x_twitter_scraper/resources/support/attachments.rb', line 36 def initialize(client:) @client = client end |
Instance Method Details
#download(id, range: nil, request_options: {}) ⇒ StringIO
Streams an authenticated user's support image or video. Video requests support one standard byte range for seeking and resumable playback.
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/x_twitter_scraper/resources/support/attachments.rb', line 22 def download(id, params = {}) parsed, = XTwitterScraper::Support::AttachmentDownloadParams.dump_request(params) @client.request( method: :get, path: ["support/attachments/%1$s", id], headers: {"accept" => "application/octet-stream", **parsed}.transform_keys(range: "range"), model: StringIO, options: ) end |