build

in lib/facebook_ads/ad_objects/server_side/custom_data.rb [165:235]


      def build(attributes = {})
        return unless attributes.is_a?(Hash)

        
        attributes = attributes.each_with_object({}) { |(k, v), h| h[k.to_sym] = v }

        if attributes.has_key?(:'value')
          self.value = attributes[:'value']
        end

        if attributes.has_key?(:'currency')
          self.currency = attributes[:'currency']
        end

        if attributes.has_key?(:'content_name')
          self.content_name = attributes[:'content_name']
        end

        if attributes.has_key?(:'content_category')
          self.content_category = attributes[:'content_category']
        end

        if attributes.has_key?(:'content_ids')
          if (value = attributes[:'content_ids']).is_a?(Array)
            self.content_ids = value
          end
        end

        if attributes.has_key?(:'contents')
          if (value = attributes[:'contents']).is_a?(Array)
            self.contents = value
          end
        end

        if attributes.has_key?(:'content_type')
          self.content_type = attributes[:'content_type']
        end

        if attributes.has_key?(:'order_id')
          self.order_id = attributes[:'order_id']
        end

        if attributes.has_key?(:'predicted_ltv')
          self.predicted_ltv = attributes[:'predicted_ltv']
        end

        if attributes.has_key?(:'num_items')
          self.num_items = attributes[:'num_items']
        end

        if attributes.has_key?(:'status')
          self.status = attributes[:'status']
        end

        if attributes.has_key?(:'search_string')
          self.search_string = attributes[:'search_string']
        end

        if attributes.has_key?(:'delivery_category')
          self.delivery_category = attributes[:'delivery_category']
        end

        if attributes.has_key?(:'item_number')
          self.item_number = attributes[:'item_number']
        end

        if attributes.has_key?(:'custom_properties')
          self.custom_properties = attributes[:'custom_properties']
        end
      end