Class: Access::Campaign
- Inherits:
-
Object
- Object
- Access::Campaign
- Includes:
- MuchMeta
- Defined in:
- lib/access/campaign.rb
Class Method Summary collapse
- .find(campaign_key, options = {}) ⇒ Object
- .process_batch(chunk) ⇒ Object
- .search(options = {}) ⇒ Object
Instance Method Summary collapse
-
#initialize(values) ⇒ Campaign
constructor
A new instance of Campaign.
Methods included from MuchMeta
Constructor Details
#initialize(values) ⇒ Campaign
Returns a new instance of Campaign.
17 18 19 20 21 22 23 24 25 26 |
# File 'lib/access/campaign.rb', line 17 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 |
Class Method Details
.find(campaign_key, options = {}) ⇒ Object
9 10 11 |
# File 'lib/access/campaign.rb', line 9 def self.find(campaign_key, = {}) Access::Api.new.find_campaign campaign_key, end |
.process_batch(chunk) ⇒ Object
13 14 15 |
# File 'lib/access/campaign.rb', line 13 def self.process_batch(chunk) chunk.map { |campaign| new(campaign) } end |
.search(options = {}) ⇒ Object
5 6 7 |
# File 'lib/access/campaign.rb', line 5 def self.search( = {}) Access::Api.new.search_campaigns end |