Class: FbGraph::AdCampaignStat

Inherits:
Node
  • Object
show all
Defined in:
lib/fb_graph/ad_campaign_stat.rb

Instance Attribute Summary (collapse)

Attributes inherited from Node

#access_token, #endpoint, #identifier, #raw_attributes

Instance Method Summary (collapse)

Methods inherited from Node

#connection, #destroy, fetch, #fetch, #update

Methods included from Comparison

#==

Constructor Details

- (AdCampaignStat) initialize(identifier, attributes = {})

Returns a new instance of AdCampaignStat



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
# File 'lib/fb_graph/ad_campaign_stat.rb', line 6

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

Instance Attribute Details

- (Object) actions

Returns the value of attribute actions



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def actions
  @actions
end

- (Object) campaign_id

Returns the value of attribute campaign_id



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def campaign_id
  @campaign_id
end

- (Object) clicks

Returns the value of attribute clicks



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def clicks
  @clicks
end

- (Object) connections

Returns the value of attribute connections



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def connections
  @connections
end

- (Object) end_time

Returns the value of attribute end_time



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def end_time
  @end_time
end

- (Object) impressions

Returns the value of attribute impressions



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def impressions
  @impressions
end

- (Object) social_clicks

Returns the value of attribute social_clicks



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def social_clicks
  @social_clicks
end

- (Object) social_impressions

Returns the value of attribute social_impressions



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def social_impressions
  @social_impressions
end

- (Object) social_spent

Returns the value of attribute social_spent



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def social_spent
  @social_spent
end

- (Object) social_unique_clicks

Returns the value of attribute social_unique_clicks



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def social_unique_clicks
  @social_unique_clicks
end

- (Object) social_unique_impressions

Returns the value of attribute social_unique_impressions



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def social_unique_impressions
  @social_unique_impressions
end

- (Object) spent

Returns the value of attribute spent



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def spent
  @spent
end

- (Object) start_time

Returns the value of attribute start_time



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def start_time
  @start_time
end

- (Object) unique_clicks

Returns the value of attribute unique_clicks



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def unique_clicks
  @unique_clicks
end

- (Object) unique_impressions

Returns the value of attribute unique_impressions



3
4
5
# File 'lib/fb_graph/ad_campaign_stat.rb', line 3

def unique_impressions
  @unique_impressions
end