Class: PPC::Operation::Group

Inherits:
Object
  • Object
show all
Includes:
PPC::Operation, Creative_operation, Keyword_operation, Sublink_operation
Defined in:
lib/ppc/operation/group.rb

Instance Attribute Summary

Attributes included from PPC::Operation

#id

Instance Method Summary collapse

Methods included from Sublink_operation

#method_missing

Methods included from Creative_operation

#method_missing

Methods included from Keyword_operation

#method_missing

Methods included from PPC::Operation

#call, #download, #initialize, #method_missing, #qihu_refresh_token

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class PPC::Operation::Sublink_operation

Instance Method Details

#add_creative(creatives) ⇒ Object



44
45
46
# File 'lib/ppc/operation/group.rb', line 44

def add_creative( creatives )
  call( "creative" ).add( @auth, creatives.map{|creative| creative.merge(group_id: @id)} )
end

#add_keyword(keywords) ⇒ Object

Overwrite add method to provide more function



40
41
42
# File 'lib/ppc/operation/group.rb', line 40

def add_keyword( keywords )
  call( "keyword" ).add( @auth, keywords.map{|keyword| keyword.merge(group_id: @id)} )
end

#creative_idsObject



18
19
20
# File 'lib/ppc/operation/group.rb', line 18

def creative_ids
  call( "creative" ).ids( @auth, [@id].flatten )
end

#creativesObject



14
15
16
# File 'lib/ppc/operation/group.rb', line 14

def creatives
  call( "creative" ).all( @auth, [@id].flatten )
end

#keyword_idsObject



10
11
12
# File 'lib/ppc/operation/group.rb', line 10

def keyword_ids
  call( "keyword" ).ids( @auth, [@id].flatten )
end

#keywordsObject



6
7
8
# File 'lib/ppc/operation/group.rb', line 6

def keywords
  call( "keyword" ).all( @auth, [@id].flatten )
end

#search_keyword(keyword) ⇒ Object



48
49
50
# File 'lib/ppc/operation/group.rb', line 48

def search_keyword( keyword )
  call( "keyword" ).search( @auth, {group_id: @id, keyword: keyword})
end


26
27
28
# File 'lib/ppc/operation/group.rb', line 26

def sublink_ids
  call( "sublink" ).ids( @auth, [@id].flatten )
end


22
23
24
# File 'lib/ppc/operation/group.rb', line 22

def sublinks
  call( "sublink" ).all( @auth, [@id].flatten )
end