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

Constants inherited from Base

Base::CONFIGURATION_YAML

Instance Method Summary collapse

Methods inherited from Base

#<=>, configuration, configuration=, connection, connection=, create!, destroy, #destroy, find, has_one, #new_record?, openx_accessor, #save!

Constructor Details

#initialize(params = {}) ⇒ Campaign

Returns a new instance of Campaign.

Raises:

  • (ArgumentError)


35
36
37
38
39
# File 'lib/openx/services/campaign.rb', line 35

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

Instance Method Details

#bannersObject



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

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