Class: PPC::API::Qihu::Creative

Inherits:
PPC::API::Qihu show all
Defined in:
lib/ppc/api/qihu/creative.rb

Constant Summary collapse

Service =
'creative'

Class Method Summary collapse

Methods inherited from PPC::API::Qihu

make_type, process, request_http_body, request_http_header, request_uri, reverse_type, to_id_list, to_json_string

Methods included from PPC::API

#debug_off, #debug_on, #is_no_quota, #make_type, #process, #request, #request_http_body, #request_http_header, #request_uri, #reverse_type

Class Method Details

.add(auth, creatives) ⇒ Object



32
33
34
35
36
37
# File 'lib/ppc/api/qihu/creative.rb', line 32

def self.add( auth,  creatives )
  creative_types = make_type( creatives ).to_json
  body = { 'creatives' => creative_types}
  response = request( auth, Service, 'add', body )
  process( response, 'creativeIdList'){ |x| to_id_hash_list(x) }
end

.get(auth, ids) ⇒ Object



26
27
28
29
30
# File 'lib/ppc/api/qihu/creative.rb', line 26

def self.get( auth, ids )
  body  = { 'idList' => to_json_string( ids ) }
  response = request( auth, Service, 'getInfoByIdList', body )
  process( response, 'creativeList'){ |x| reverse_type(x) }
end