Class: Insightly::Contact

Inherits:
ReadWrite show all
Includes:
AddressHelper, ContactInfoHelper, LinkHelper, TagHelper
Defined in:
lib/insightly/contact.rb

Constant Summary collapse

CUSTOM_FIELD_PREFIX =
"CONTACT_FIELD"

Instance Method Summary collapse

Methods included from TagHelper

#add_tag, #tags, #tags=

Methods included from LinkHelper

#add_link, #links, #links=

Methods included from ContactInfoHelper

#add_contact_info, #contact_infos, #contact_infos=

Methods included from AddressHelper

#add_address, #addresses, #addresses=

Methods inherited from ReadWrite

#post_collection, #put_collection, #save, #to_json, #update_data

Methods inherited from Base

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

Constructor Details

#initialize(id = nil) ⇒ Contact

Returns a new instance of Contact.



30
31
32
33
34
# File 'lib/insightly/contact.rb', line 30

def initialize(id = nil)
  @data = {}
  @data["ADDRESSES"] = []
  load(id) if id
end

Instance Method Details



38
39
40
41
42
# File 'lib/insightly/contact.rb', line 38

def fix_for_link(link)
  #This needs to auto set the org id on the item
  link.contact_id = self.remote_id
  link
end

#remote_idObject



35
36
37
# File 'lib/insightly/contact.rb', line 35

def remote_id
  contact_id
end