Class: XTwitterScraper::Resources::Events
- Inherits:
-
Object
- Object
- XTwitterScraper::Resources::Events
- Defined in:
- lib/x_twitter_scraper/resources/events.rb
Overview
Activity events from monitored accounts
Instance Method Summary collapse
-
#initialize(client:) ⇒ Events
constructor
private
A new instance of Events.
-
#list(after: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) ⇒ XTwitterScraper::Models::EventListResponse
List events.
-
#retrieve(id, request_options: {}) ⇒ XTwitterScraper::Models::EventDetail
Get event.
Constructor Details
#initialize(client:) ⇒ Events
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 Events.
60 61 62 |
# File 'lib/x_twitter_scraper/resources/events.rb', line 60 def initialize(client:) @client = client end |
Instance Method Details
#list(after: nil, event_type: nil, limit: nil, monitor_id: nil, request_options: {}) ⇒ XTwitterScraper::Models::EventListResponse
List events
44 45 46 47 48 49 50 51 52 53 54 55 |
# File 'lib/x_twitter_scraper/resources/events.rb', line 44 def list(params = {}) parsed, = XTwitterScraper::EventListParams.dump_request(params) query = XTwitterScraper::Internal::Util.encode_query_params(parsed) @client.request( method: :get, path: "events", query: query.transform_keys(event_type: "eventType", monitor_id: "monitorId"), model: XTwitterScraper::Models::EventListResponse, security: {auth_api_key: true}, options: ) end |
#retrieve(id, request_options: {}) ⇒ XTwitterScraper::Models::EventDetail
Get event
18 19 20 21 22 23 24 25 |
# File 'lib/x_twitter_scraper/resources/events.rb', line 18 def retrieve(id, params = {}) @client.request( method: :get, path: ["events/%1$s", id], model: XTwitterScraper::EventDetail, options: params[:request_options] ) end |