Class: Insightly::TaskLink

Inherits:
ReadOnly show all
Defined in:
lib/insightly/task_link.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from ReadOnly

#==, #build, build, #config, #get_collection, #initialize, #process, #remote_data

Methods inherited from Base

#==, all, api_field, build, #build, #config, custom_fields, #get_collection, #initialize, #load, #process, #reload, #remote_data, #to_json, #url_base

Constructor Details

This class inherits a constructor from Insightly::ReadOnly

Class Method Details

.add_contact(id) ⇒ Object



26
27
28
29
30
# File 'lib/insightly/task_link.rb', line 26

def self.add_contact(id)
  item = TaskLink.new
  item.contact_id = id
  item
end

.add_opportunity(id) ⇒ Object



32
33
34
35
36
37
# File 'lib/insightly/task_link.rb', line 32

def self.add_opportunity(id)
  item = TaskLink.new
  item.opportunity_id = id

  item
end

.add_organisation(id) ⇒ Object



39
40
41
42
43
# File 'lib/insightly/task_link.rb', line 39

def self.add_organisation(id)
  item = TaskLink.new
  item.organisation_id = id
  item
end

.search_by_opportunity_id(opportunity_id) ⇒ Object



16
17
18
19
20
21
22
23
24
# File 'lib/insightly/task_link.rb', line 16

def self.search_by_opportunity_id(opportunity_id)
  list = []
  TaskLink.all.each do |x|
    if  !x.task_id.nil? && x.opportunity_id == opportunity_id
      list << x
    end
  end
  list
end

Instance Method Details

#remote_idObject



12
13
14
# File 'lib/insightly/task_link.rb', line 12

def remote_id
  self.task_link_id
end