Class: XTwitterScraper::Resources::X::Tweets::Retweet
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::X::Tweets::Retweet
- Defined in:
- lib/x_twitter_scraper/resources/x/tweets/retweet.rb
Overview
X write actions (tweets, likes, follows, DMs)
Instance Method Summary collapse
-
#create(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::RetweetCreateResponse
Retweet.
-
#delete(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse
Unretweet.
-
#initialize(client:) ⇒ Retweet
constructor
private
A new instance of Retweet.
Constructor Details
#initialize(client:) ⇒ Retweet
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 Retweet.
60 61 62 |
# File 'lib/x_twitter_scraper/resources/x/tweets/retweet.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#create(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::RetweetCreateResponse
Retweet
22 23 24 25 26 27 28 29 30 31 |
# File 'lib/x_twitter_scraper/resources/x/tweets/retweet.rb', line 22 def create(id, params) parsed, = XTwitterScraper::X::Tweets::RetweetCreateParams.dump_request(params) @client.request( method: :post, path: ["x/tweets/%1$s/retweet", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::RetweetCreateResponse, options: ) end |
#delete(id, account:, request_options: {}) ⇒ XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse
Unretweet
46 47 48 49 50 51 52 53 54 55 |
# File 'lib/x_twitter_scraper/resources/x/tweets/retweet.rb', line 46 def delete(id, params) parsed, = XTwitterScraper::X::Tweets::RetweetDeleteParams.dump_request(params) @client.request( method: :delete, path: ["x/tweets/%1$s/retweet", id], body: parsed, model: XTwitterScraper::Models::X::Tweets::RetweetDeleteResponse, options: ) end |