Sha256: 4a44347626d75c7c6392a6770fe549906d087eca96e994836d50cb983b068a22

Contents?: true

Size: 783 Bytes

Versions: 7

Compression:

Stored size: 783 Bytes

Contents

module FbGraph
  module Connections
    module AdGroups
      def ad_groups(options = {})
        ad_groups = self.connection(:adgroups, options)
        ad_groups.map! do |ad_group|
          AdGroup.new(ad_group[:id], ad_group.merge(
            :access_token => options[:access_token] || self.access_token
          ))
        end
      end

      # Note: AdGroups can only be created via the AdAccount connection. Even though it makes sense, they
      # cannot be created via the AdCampaign connection
      def ad_group!(options = {})
        ad_group = post(options.merge(:connection => :adgroups))
        AdGroup.new(ad_group[:id], options.merge(ad_group).merge(
          :access_token => options[:access_token] || self.access_token
        ))
      end
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
fb_graph-2.1.6 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.5 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.4 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.3 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.2 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.1 lib/fb_graph/connections/ad_groups.rb
fb_graph-2.1.0 lib/fb_graph/connections/ad_groups.rb