Class: YandexDirect::Client
- Inherits:
-
Object
- Object
- YandexDirect::Client
show all
- Includes:
- V5::API
- Defined in:
- lib/yandex_direct.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Methods included from V5::VCards
#add_v_cards, #v_cards
#add_sitelinks, #sitelinks
#add_keywords, #keywords
#dictionaries
#add_campaigns, #campaigns
#ad_images, #add_ad_images
#ad_groups, #add_ad_groups
Methods included from V5::Ads
#add_ads, #ads, #moderate_ads
Constructor Details
#initialize(options = {}) {|_self| ... } ⇒ Client
Returns a new instance of Client.
19
20
21
22
23
24
25
26
27
28
|
# File 'lib/yandex_direct.rb', line 19
def initialize(options = {})
options.each do |key, value|
instance_variable_set("@#{key}", value)
end
@url = 'https://api.direct.yandex.ru/json-api/v4/'
@url_live = 'https://api.direct.yandex.ru/live/v4/json/'
yield(self) if block_given?
end
|
Instance Attribute Details
#app_id ⇒ Object
Returns the value of attribute app_id.
16
17
18
|
# File 'lib/yandex_direct.rb', line 16
def app_id
@app_id
end
|
#available_units ⇒ Object
Returns the value of attribute available_units.
17
18
19
|
# File 'lib/yandex_direct.rb', line 17
def available_units
@available_units
end
|
#login ⇒ Object
Returns the value of attribute login.
16
17
18
|
# File 'lib/yandex_direct.rb', line 16
def login
@login
end
|
#test ⇒ Object
Returns the value of attribute test.
16
17
18
|
# File 'lib/yandex_direct.rb', line 16
def test
@test
end
|
#token ⇒ Object
Returns the value of attribute token.
16
17
18
|
# File 'lib/yandex_direct.rb', line 16
def token
@token
end
|
Instance Method Details
62
63
64
|
# File 'lib/yandex_direct.rb', line 62
def banners_tags(param)
request_live('GetBannersTags', param)
end
|
54
55
56
|
# File 'lib/yandex_direct.rb', line 54
def campaigns_tags(param)
request_live('GetCampaignsTags', param)
end
|
#create_new_wordstat_report(param = nil) ⇒ Object
30
31
32
33
|
# File 'lib/yandex_direct.rb', line 30
def create_new_wordstat_report(param = nil)
param ||= { Phrases: ['синтепон'], GeoID: [213] }
request('CreateNewWordstatReport', param)['data']
end
|
#delete_wordstat_report(param) ⇒ Object
35
36
37
|
# File 'lib/yandex_direct.rb', line 35
def delete_wordstat_report(param)
request('DeleteWordstatReport', param)
end
|
#ping_api ⇒ Object
66
67
68
|
# File 'lib/yandex_direct.rb', line 66
def ping_api
request('PingAPI')
end
|
58
59
60
|
# File 'lib/yandex_direct.rb', line 58
def update_banners_tags(param)
request_live('UpdateBannersTags', param)
end
|
50
51
52
|
# File 'lib/yandex_direct.rb', line 50
def update_campaigns_tags(param)
request_live('UpdateCampaignsTags', param)
end
|
#wordstat_report(param) ⇒ Object
39
40
41
42
43
44
|
# File 'lib/yandex_direct.rb', line 39
def wordstat_report(param)
result = request('GetWordstatReport', param)
raise(YandexDirect::BlankDataError, 'Blank data') if result['data'].empty?
result
end
|
#wordstat_report_list ⇒ Object
46
47
48
|
# File 'lib/yandex_direct.rb', line 46
def wordstat_report_list
request('GetWordstatReportList')
end
|