Class: Yandex::API::Direct::BannerInfo
- Inherits:
-
Base
- Object
- Base
- Yandex::API::Direct::BannerInfo
show all
- Defined in:
- lib/yandex-api/direct/banner_info.rb
Overview
Class Method Summary
collapse
Instance Method Summary
collapse
Methods inherited from Base
arrays, attributes, direct_arrays, direct_attributes, direct_objects, #initialize, objects, #to_hash
Class Method Details
.find(id) ⇒ Object
55
56
57
58
59
|
# File 'lib/yandex-api/direct/banner_info.rb', line 55
def self.find id
result = Direct::request('GetBanners', {:BannerIDS => [id]})
raise Yandex::NotFound.new("not found banner where id = #{id}") unless result.any?
banner = new(result.first)
end
|
Instance Method Details
#archive ⇒ Object
64
65
66
|
# File 'lib/yandex-api/direct/banner_info.rb', line 64
def archive
Direct::request('ArchiveBanners', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|
#delete ⇒ Object
79
80
81
|
# File 'lib/yandex-api/direct/banner_info.rb', line 79
def delete
Direct::request('DeleteBanners', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|
#moderate ⇒ Object
70
71
72
|
# File 'lib/yandex-api/direct/banner_info.rb', line 70
def moderate
Direct::request('ModerateBanners', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|
#resume ⇒ Object
73
74
75
|
# File 'lib/yandex-api/direct/banner_info.rb', line 73
def resume
Direct::request('ResumeBanners', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|
#save ⇒ Object
60
61
62
|
# File 'lib/yandex-api/direct/banner_info.rb', line 60
def save
Direct::request('CreateOrUpdateBanners', [self.to_hash]).first
end
|
#stop ⇒ Object
76
77
78
|
# File 'lib/yandex-api/direct/banner_info.rb', line 76
def stop
Direct::request('StopBanners', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|
#unarchive ⇒ Object
67
68
69
|
# File 'lib/yandex-api/direct/banner_info.rb', line 67
def unarchive
Direct::request('UnArchiveCampaign', {:CampaignID => self.CampaignID, :BannerIDS => [self.BannerID]})
end
|