Sha256: 38ec35c0f6878dbae1b3edadfe9e17c289fea5646d8d52a843c4dc177ccda57c

Contents?: true

Size: 824 Bytes

Versions: 14

Compression:

Stored size: 824 Bytes

Contents

module Access
  class Campaign
    include Access::MuchMeta

    def self.search(options = {})
      Access::Api.new.search_campaigns options
    end

    def self.find(campaign_key, options = {})
      Access::Api.new.find_campaign campaign_key, options
    end

    def self.process_batch(chunk)
      chunk.map { |campaign| new(campaign) }
    end

    def initialize(values)
      @used_fields = []
      set_up_methods(values)
      set_values(values)
      @spots = Access::Spot.process_batch(@spots) if @spots
      @spot_list = Access::Spot.process_batch(@spot_list) if @spot_list
      @channels = Access::Channel.process_batch(@channels) if @channels
      @channel_list = Access::Channel.process_batch(@channel_list) if @channel_list
      @links = Access::Link.process_batch(@links) if @links
    end

  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
access-2.3.0.pre.rc2 lib/access/campaign.rb
access-2.3.0.pre.rc1 lib/access/campaign.rb
access-2.2.0 lib/access/campaign.rb
access-2.1.5 lib/access/campaign.rb
access-2.1.4 lib/access/campaign.rb
access-2.1.3 lib/access/campaign.rb
access-2.1.2 lib/access/campaign.rb
access-2.1.1 lib/access/campaign.rb
access-2.1.0 lib/access/campaign.rb
access-2.0.55 lib/access/campaign.rb
access-2.0.54 lib/access/campaign.rb
access-2.0.53 lib/access/campaign.rb
access-2.0.52 lib/access/campaign.rb
access-2.0.51 lib/access/campaign.rb