Class: CapsuleCRM::Person
Instance Attribute Summary collapse
-
#about ⇒ Object
Returns the value of attribute about.
-
#first_name ⇒ Object
Returns the value of attribute first_name.
-
#job_title ⇒ Object
Returns the value of attribute job_title.
-
#last_name ⇒ Object
Returns the value of attribute last_name.
-
#note ⇒ Object
Returns the value of attribute note.
-
#organisation_id ⇒ Object
Returns the value of attribute organisation_id.
-
#title ⇒ Object
Returns the value of attribute title.
Attributes inherited from Base
Instance Method Summary collapse
-
#attributes ⇒ Object
nodoc.
-
#organisation ⇒ Object
nodoc.
-
#save ⇒ Object
nodoc.
Methods inherited from Party
#addresses, #custom_fields, #emails, find_all_by_email, find_by_email, get_path, #is?, #phone_numbers, search, #tag, #tag_names, #tags, #untag, #websites
Methods included from History
#add_history, #history, #history!
Methods inherited from Base
#==, #errors, find, #initialize, last_response, #new_record?
Constructor Details
This class inherits a constructor from CapsuleCRM::Base
Instance Attribute Details
#about ⇒ Object
Returns the value of attribute about.
3 4 5 |
# File 'lib/capsulecrm/person.rb', line 3 def about @about end |
#first_name ⇒ Object
Returns the value of attribute first_name.
4 5 6 |
# File 'lib/capsulecrm/person.rb', line 4 def first_name @first_name end |
#job_title ⇒ Object
Returns the value of attribute job_title.
5 6 7 |
# File 'lib/capsulecrm/person.rb', line 5 def job_title @job_title end |
#last_name ⇒ Object
Returns the value of attribute last_name.
6 7 8 |
# File 'lib/capsulecrm/person.rb', line 6 def last_name @last_name end |
#note ⇒ Object
Returns the value of attribute note.
9 10 11 |
# File 'lib/capsulecrm/person.rb', line 9 def note @note end |
#organisation_id ⇒ Object
Returns the value of attribute organisation_id.
7 8 9 |
# File 'lib/capsulecrm/person.rb', line 7 def organisation_id @organisation_id end |
#title ⇒ Object
Returns the value of attribute title.
8 9 10 |
# File 'lib/capsulecrm/person.rb', line 8 def title @title end |
Instance Method Details
#attributes ⇒ Object
nodoc
15 16 17 18 19 20 21 22 |
# File 'lib/capsulecrm/person.rb', line 15 def attributes attrs = {} arr = [:about, :first_name, :last_name, :title, :job_title] arr.each do |key| attrs[key] = self.send(key) end attrs end |
#organisation ⇒ Object
nodoc
47 48 49 50 |
# File 'lib/capsulecrm/person.rb', line 47 def organisation return nil if organisation_id.nil? @organisation ||= CapsuleCRM::Organisation.find(organisation_id) end |
#save ⇒ Object
nodoc
54 55 56 |
# File 'lib/capsulecrm/person.rb', line 54 def save new_record?? create : update end |