Class: Insightly::Organisation

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

Constant Summary collapse

CUSTOM_FIELD_PREFIX =
"ORGANISATION_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) ⇒ Organisation

Returns a new instance of Organisation.



29
30
31
32
33
# File 'lib/insightly/organisation.rb', line 29

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

Instance Method Details



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

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

#remote_idObject



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

def remote_id
  organisation_id
end