Sha256: 338cd4569c9eb89d42f3c3d665b9cbd133b5f8ed3591fdebab55d0858d40fb5e

Contents?: true

Size: 1.02 KB

Versions: 5

Compression:

Stored size: 1.02 KB

Contents

module OpenX
  module Services
    class Publisher < Base
      openx_accessor :name          => :publisherName,
                     :contact_name  => :contactName,
                     :email         => :emailAddress,
                     :username      => :username,
                     :password      => :password,
                     :id            => :publisherId,
                     :agency_id     => :agencyId,
                     :website       => :website

      has_one :agency

      self.create   = 'ox.addPublisher'
      self.update   = 'ox.modifyPublisher'
      self.delete   = 'ox.deletePublisher'
      self.find_one = 'ox.getPublisher'
      self.find_all = 'ox.getPublisherListByAgencyId'

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

      def zones
        Zone.find(:all, self.id)
      end

      def channels
        Channel.find(:all, self.id)
      end
    end
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
krakatoa-openx-1.9.4 lib/openx/services/publisher.rb
bsm-openx-1.9.4 lib/openx/services/publisher.rb
bsm-openx-1.9.3 lib/openx/services/publisher.rb
bsm-openx-1.9.2 lib/openx/services/publisher.rb
bsm-openx-1.9.1 lib/openx/services/publisher.rb