Sha256: 1244e0cadc23164f46f774821501958edd4571fdc93fb11dca28947df102576d

Contents?: true

Size: 988 Bytes

Versions: 1

Compression:

Stored size: 988 Bytes

Contents

module OpenX
  module Services
    class Advertiser < Base
      openx_accessor :name          => :advertiserName,
                     :contact_name  => :contactName,
                     :email         => :emailAddress,
                     :username      => :username,
                     :password      => :password,
                     :agency_id     => :agencyId,
                     :id            => :advertiserId

      has_one :agency

      self.endpoint = '/AdvertiserXmlRpcService.php'
      self.create   = 'addAdvertiser'
      self.update   = 'modifyAdvertiser'
      self.delete   = 'deleteAdvertiser'
      self.find_one = 'getAdvertiser'
      self.find_all = 'getAdvertiserListByAgencyId'

      def initialize(params = {})
        raise "need agency" unless params[:agency_id] || params[:agency]
        params[:agency_id] ||= params[:agency].id
        super(params)
      end

      def campaigns
        Campaign.find(:all, self.id)
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
openx-1.0.0 lib/openx/services/advertiser.rb