Sha256: 1c4c4635376589eb6f968820f0b41eed9509645681192425a4374ba4277d9b69

Contents?: true

Size: 1.1 KB

Versions: 3

Compression:

Stored size: 1.1 KB

Contents

module Neuron
  module Client
    class Ad
      include Connected
      resource_name("ad")
      resources_name("ads")

      attr_accessor :name, :approved, :response_type, :parameters, :geo_target_ids,
        # redirect
          :redirect_url,
        # video
          :video_api_url, :video_setup_xml, :video_flv_url, 
          :video_clickthru_url, :video_companion_ad_html, :social_links, :social_links_attributes,
        # caps
          :frequency_cap_limit, :frequency_cap_window, :overall_cap, 
          :daily_cap, :day_partitions, :ideal_impressions_per_hour,
        # range
          :start_datetime, :end_datetime, :time_zone,
        # timestamps
          :created_at, :updated_at
      
      def self.stringify_day_partitions(days)
        result = ""
        168.times do |i|
          result << (days[i.to_s] || "F")
        end
        result
      end

      def recent(statistic, parameters)
        self.class.connection.get("ads/#{id}/recent/#{statistic}", parameters)
      end

      def unlink(ad_id)
        self.class.connection.delete("ads/#{id}/zones/#{ad_id}")
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
neuron-client-0.1.0 lib/neuron-client/ad.rb
neuron-client-0.0.9 lib/neuron-client/ad.rb
neuron-client-0.0.8 lib/neuron-client/ad.rb