Class: FacebookAds::AdImage

Inherits:
Base
  • Object
show all
Defined in:
lib/facebook_ads/ad_image.rb

Overview

An ad image belongs to an ad account. An image will always produce the same hash. developers.facebook.com/docs/marketing-api/reference/ad-image

Constant Summary collapse

FIELDS =
%w[id hash account_id name permalink_url original_width original_height].freeze

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Base

delete, get, paginate, post, #save

Class Method Details

.find(_id) ⇒ Object

Raises:

  • (Exception)


9
10
11
# File 'lib/facebook_ads/ad_image.rb', line 9

def find(_id)
  raise Exception, 'NOT IMPLEMENTED'
end

Instance Method Details

#destroyObject



26
27
28
# File 'lib/facebook_ads/ad_image.rb', line 26

def destroy
  super(path: "/act_#{}/adimages", query: { hash: self[:hash] })
end

#hashObject

@TODO: You are setting a key that conflicts with a built-in method FacebookAds::AdImage#hash defined in Hash. This can cause unexpected behavior when accessing the key via as a property. You can still access the key via the #[] method.



18
19
20
# File 'lib/facebook_ads/ad_image.rb', line 18

def hash
  self[:hash]
end

#update(_data) ⇒ Object

Raises:

  • (Exception)


22
23
24
# File 'lib/facebook_ads/ad_image.rb', line 22

def update(_data)
  raise Exception, 'NOT IMPLEMENTED'
end