Class: OpenX::Services::Campaign

Inherits:
Base
  • Object
show all
Defined in:
lib/openx/services/campaign.rb

Constant Summary collapse

CPM =

Revenue types

1
CPC =
2
CPA =
3
MONTHLY_TENANCY =
4
REMNANT =

Campaign types

1
HIGH =
2
EXCLUSIVE =
3

Instance Method Summary collapse

Methods inherited from Base

#<=>, establish_connection, has_one, #new_record?, openx_accessor, remote, with_connection

Methods included from Persistance::ClassMethods

#create!, #destroy, #find

Methods included from Persistance::InstanceMethods

#destroy, #save!

Constructor Details

#initialize(params = {}) ⇒ Campaign

Returns a new instance of Campaign.

Raises:

  • (ArgumentError)


41
42
43
44
45
# File 'lib/openx/services/campaign.rb', line 41

def initialize(params = {})
  raise ArgumentError.new("Missing advertiser_id") unless params[:advertiser_id] || params[:advertiser]
  params[:advertiser_id] ||= params[:advertiser].id
  super(params)
end

Instance Method Details

#bannersObject



47
48
49
# File 'lib/openx/services/campaign.rb', line 47

def banners
  Banner.find(:all, self.id)
end