Class: FacebookAds::FieldTypes::AdObject

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

Instance Method Summary collapse

Methods included from FacebookAds::FieldTypes

#for, #lookup, #register

Constructor Details

#initialize(ad_object_class) ⇒ AdObject

Returns a new instance of AdObject.



12
13
14
# File 'lib/facebook_ads/field_types/ad_object.rb', line 12

def initialize(ad_object_class)
  @ad_object_class = ad_object_class
end

Instance Method Details

#deserialize(value, session = nil) ⇒ Object



16
17
18
# File 'lib/facebook_ads/field_types/ad_object.rb', line 16

def deserialize(value, session = nil)
  @ad_object_class.new(value, value.keys, session)
end

#serialize(value) ⇒ Object



20
21
22
# File 'lib/facebook_ads/field_types/ad_object.rb', line 20

def serialize(value)
  value.to_json
end