Sha256: 6539d739b012cca598e59d8c9687e00a22abed905df0033e28525593fcefdd69

Contents?: true

Size: 1.76 KB

Versions: 24

Compression:

Stored size: 1.76 KB

Contents

require 'epom/epom_element'

module Epom
  class Advertiser < EpomElement

    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

    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

  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
epom-0.10.13 lib/epom/advertiser.rb
epom-0.10.11 lib/epom/advertiser.rb
epom-0.10.10 lib/epom/advertiser.rb
epom-0.10.9 lib/epom/advertiser.rb
epom-0.10.8 lib/epom/advertiser.rb
epom-0.10.7 lib/epom/advertiser.rb
epom-0.10.5 lib/epom/advertiser.rb
epom-0.10 lib/epom/advertiser.rb
epom-0.9.9 lib/epom/advertiser.rb
epom-0.9.8 lib/epom/advertiser.rb
epom-0.9.7 lib/epom/advertiser.rb
epom-0.9.6 lib/epom/advertiser.rb
epom-0.9.4 lib/epom/advertiser.rb
epom-0.9.2 lib/epom/advertiser.rb
epom-0.9.1 lib/epom/advertiser.rb
epom-0.9 lib/epom/advertiser.rb
epom-0.8.5 lib/epom/advertiser.rb
epom-0.8.4 lib/epom/advertiser.rb
epom-0.8.1 lib/epom/advertiser.rb
epom-0.8 lib/epom/advertiser.rb