class TwitterAds::Creative::Cards

Constants

RESOURCE

Attributes

account[R]

Public Class Methods

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

Public Instance Methods

create(account, name, components) click to toggle source
# File lib/twitter-ads/creative/cards.rb, line 36
def create(account, name, components)
  resource = RESOURCE % { account_id: account.id }
  params = { 'name': name, 'components': components }
  headers = { 'Content-Type' => 'application/json' }
  response = Request.new(account.client,
                         :post,
                         resource,
                         headers: headers,
                         body: params.to_json).perform
  from_response(response.body[:data])
end
load(*) click to toggle source
# File lib/twitter-ads/creative/cards.rb, line 26
def load(*)
  raise ArgumentError.new(
    "'Cards' object has no attribute 'load'")
end
reload(*) click to toggle source
# File lib/twitter-ads/creative/cards.rb, line 31
def reload(*)
  raise ArgumentError.new(
    "'Cards' object has no attribute 'reload'")
end