Class: Highrise::Person

Inherits:
Subject
  • Object
show all
Includes:
CustomFields, Pagination, Searchable, Taggable
Defined in:
lib/highrise/person.rb

Instance Method Summary collapse

Methods included from CustomFields

#convert_method_to_field_label, #field, #method_missing, #new_subject_data, #set_field_value, #transform_subject_field_label

Methods included from Searchable

included

Methods included from Taggable

#tag!, #tags, #untag!

Methods included from Pagination

included

Methods inherited from Subject

#add_note, #add_task, #emails, #notes, #upcoming_tasks

Methods inherited from Base

headers, oauth_token=

Dynamic Method Handling

This class handles dynamic methods through the method_missing method in the class Highrise::CustomFields

Instance Method Details

#addressObject


16
17
18
# File 'lib/highrise/person.rb', line 16

def address
  contact_data.addresses.first
end

#companyObject


8
9
10
# File 'lib/highrise/person.rb', line 8

def company
  Company.find(company_id) if company_id
end

#email_addressesObject


24
25
26
# File 'lib/highrise/person.rb', line 24

def email_addresses
  contact_data.email_addresses.collect { |address| address.address } rescue []
end

#labelObject


32
33
34
# File 'lib/highrise/person.rb', line 32

def label
  'Party'
end

#nameObject


12
13
14
# File 'lib/highrise/person.rb', line 12

def name
  "#{first_name rescue ''} #{last_name rescue ''}".strip
end

#phone_numbersObject


28
29
30
# File 'lib/highrise/person.rb', line 28

def phone_numbers
  contact_data.phone_numbers.collect { |phone_number| phone_number.number } rescue []
end

#web_addressObject


20
21
22
# File 'lib/highrise/person.rb', line 20

def web_address
  contact_data.web_addresses.first
end