Class: Epom::Advertiser

Inherits:
EpomElement show all
Defined in:
lib/epom/advertiser.rb

Class Method Summary collapse

Methods inherited from EpomElement

generic_method, login, method_missing, params_validation, respond_to?

Class Method Details

.extended_methodsObject



6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/epom/advertiser.rb', line 6

def self.extended_methods
  {
      :delete_advertiser => {
          :url => '/rest-api/advertisers/ADVERTISER_ID/delete.do',
          :url_parameters => [:advertiserId],
          :body_parameters => [:hash, :timestamp, :username],
          :method => :delete
      },
      :get_advertiser_permissions_for_user => {
          :url => '/rest-api/advertiserShares.do',
          :body_parameters => [:hash, :timestamp, :username],
          :method => :get
      },
      :get_campaigns_for_advertiser => {
          :url => '/rest-api/advertiser/ADVERTISER_ID/campaigns.do',
          :url_parameters => [:advertiserId],
          :body_parameters => [:hash, :timestamp, :username],
          :method => :get
      },
      :update_advertiser => {
          :url => '/rest-api/advertisers/update.do',
          :body_parameters => [:id, :name, :contactName, :contactEmail, :description, :categoryId, :hash, :timestamp, :username],
          :method => :put
      },
      :create_advertiser => {
          :url => '/rest-api/advertisers/update.do',
          :body_parameters => [:name, :contactName, :contactEmail, :description, :categoryId, :hash, :timestamp, :username],
          :method => :put
      },
      :get_advertisers_tree => {
          :url => '/rest-api/advertisers-tree.do',
          :body_parameters => [:hash, :timestamp, :username],
          :method => :get
      },
  }
end

.replace_params_in_url(url, url_params) ⇒ Object



43
44
45
46
# File 'lib/epom/advertiser.rb', line 43

def self.replace_params_in_url(url, url_params)
  url.gsub!('ADVERTISER_ID', url_params[:advertiserId].to_s) if url.include?('ADVERTISER_ID')
  url
end