Class: OpenX::Services::Advertiser

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

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 = {}) ⇒ Advertiser

Returns a new instance of Advertiser.



20
21
22
23
24
# File 'lib/openx/services/advertiser.rb', line 20

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

Instance Method Details

#campaignsObject



26
27
28
# File 'lib/openx/services/advertiser.rb', line 26

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