Class: PPC::Operation::Plan

Inherits:
Object
  • Object
show all
Includes:
PPC::Operation, Group_operation
Defined in:
lib/ppc/operation/plan.rb

Instance Attribute Summary

Attributes included from PPC::Operation

#id

Instance Method Summary collapse

Methods included from Group_operation

#delete_group, #get_group, #update_group

Methods included from PPC::Operation

#call, #download, #get_obj, #initialize, #qihu_refresh_token

Instance Method Details

#add_group(groups) ⇒ Object

Overwirte add_group method to provide more function



31
32
33
# File 'lib/ppc/operation/plan.rb', line 31

def add_group( groups )
  call('group').add( @auth, add_plan_id( groups ) )
end

#group_idsObject



21
22
23
24
25
# File 'lib/ppc/operation/plan.rb', line 21

def group_ids()
  result = call('group').search_id_by_plan_id(@auth, @id)
  result[:result] = result[:result][0][:group_ids]
  return result
end

#groupsObject



15
16
17
18
19
# File 'lib/ppc/operation/plan.rb', line 15

def groups()
  result = call('group').search_by_plan_id(@auth, @id)
  result[:result] = result[:result][0][:groups]
  return result
end

#infoObject



7
8
9
# File 'lib/ppc/operation/plan.rb', line 7

def info
  call('plan').get(@auth,@id)
end

#update(plan) ⇒ Object



11
12
13
# File 'lib/ppc/operation/plan.rb', line 11

def update( plan )
  call('plan').update( @auth, plan.merge( id:@id ) )
end