Sha256: 55c14a231d2ae7531e8075d97dde0c8b4fef615863578a4d8e927b147efcc0b7

Contents?: true

Size: 914 Bytes

Versions: 55

Compression:

Stored size: 914 Bytes

Contents

module FbGraph
  class AdCampaignStat < Node
    attr_accessor :start_time, :end_time, :campaign_id, :impressions, :clicks, :spent, :social_impressions, :social_clicks, :social_spent,
      :actions, :unique_impressions, :social_unique_impressions, :unique_clicks, :social_unique_clicks, :connections

    def initialize(identifier, attributes = {})
      super

      %w(campaign_id impressions clicks spent social_impressions social_clicks social_spent actions unique_impressions social_unique_impressions unique_clicks social_unique_clicks connections).each do |field|
        send("#{field}=", attributes[field.to_sym])
      end

      %w(start_time end_time).each do |field|
        if val = attributes[field.to_sym]
          # Handles integer timestamps and ISO8601 strings
          time = Time.parse(val) rescue Time.at(val.to_i)
          send("#{field}=", time)
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
fb_graph-2.7.17 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.16 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.15 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.14 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.13 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.12 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.11 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.10 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.9 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.8 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.7 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.6 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.5 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.4 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.3 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.2 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.1 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.7.0 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.6.7 lib/fb_graph/ad_campaign_stat.rb
fb_graph-2.6.6 lib/fb_graph/ad_campaign_stat.rb