Class: YandexApiDirect::Campaign

Inherits:
Hashr
  • Object
show all
Extended by:
YandexObject
Includes:
YandexObject
Defined in:
lib/yandex-api-direct/yandex_objects/campaign.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.find(params = {}) ⇒ Object

perform find call



12
13
14
15
16
# File 'lib/yandex-api-direct/yandex_objects/campaign.rb', line 12

def self.find params = {}
  call_method("get_campaigns_list", params)[:data].collect do |campaign_args|
    new campaign_args
  end
end

Instance Method Details

#campaign_paramsObject

get params for campaign input args:

start_date: Date
end_date: Date



24
25
26
# File 'lib/yandex-api-direct/yandex_objects/campaign.rb', line 24

def campaign_params
  CampaignParams.find campaign_ids: [campaign_id]
end

#campaign_stats(args) ⇒ Object

get stats for campaign input args:

start_date: Date
end_date: Date



34
35
36
# File 'lib/yandex-api-direct/yandex_objects/campaign.rb', line 34

def campaign_stats args
  CampaignStats.find args.merge(campaign_ids: [campaign_id])
end