class TwitterAds::Creative::TweetPreview

Constants

RESOURCE_COLLECTION

Attributes

account[R]

Public Class Methods

new(account) click to toggle source
# File lib/twitter-ads/creative/tweet_previews.rb, line 28
def initialize(account)
  @account = account
  self
end

Public Instance Methods

load(account, tweet_ids:, tweet_type:) click to toggle source
# File lib/twitter-ads/creative/tweet_previews.rb, line 20
def load(account, tweet_ids:, tweet_type:)
  params = { tweet_ids: Array(tweet_ids).join(',') }
  params[:tweet_type] = tweet_type
  resource = RESOURCE_COLLECTION % { account_id: account.id }
  request = Request.new(account.client, :get, resource, params: params)
  Cursor.new(self.class, request, init_with: [account])
end