Sha256: 3c50cb0f66fda885700f273ee51bf44024772a0d381342f5c471c4f8da129030

Contents?: true

Size: 603 Bytes

Versions: 34

Compression:

Stored size: 603 Bytes

Contents

module FbGraph
  class ReachEstimate < Node

    attr_accessor :users, :cpc_max, :cpc_median, :cpc_min, :cpm_max, :cpm_median, :cpm_min

    def initialize(attributes = {})
      super

      # everything in a data node when getting reach estimate through an AdGroup
      attributes = attributes[:data] if attributes[:data]

      %w(users).each do |field|
        send("#{field}=", attributes[field.to_sym])
      end

      %w(cpc_min cpc_median cpc_max cpm_min cpm_median cpm_max).each do |field|
        send("#{field}=", attributes[:bid_estimations][0][field.to_sym])
      end
    end
  end
end

Version data entries

34 entries across 34 versions & 1 rubygems

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