Class: Zm::Client::Contact
- Inherits:
-
Base::Object
- Object
- Base::Object
- Zm::Client::Contact
- Includes:
- BelongsToFolder, BelongsToTag
- Defined in:
- lib/zm/client/contact/contact.rb
Overview
class account tag
Constant Summary collapse
- GROUP_PATTERN =
'group'
Instance Attribute Summary collapse
-
#anniversary ⇒ Object
Returns the value of attribute anniversary.
-
#assistantPhone ⇒ Object
Returns the value of attribute assistantPhone.
-
#birthday ⇒ Object
Returns the value of attribute birthday.
-
#callbackPhone ⇒ Object
Returns the value of attribute callbackPhone.
-
#carPhone ⇒ Object
Returns the value of attribute carPhone.
-
#company ⇒ Object
Returns the value of attribute company.
-
#companyPhone ⇒ Object
Returns the value of attribute companyPhone.
-
#custom1 ⇒ Object
Returns the value of attribute custom1.
-
#department ⇒ Object
Returns the value of attribute department.
-
#email ⇒ Object
Returns the value of attribute email.
-
#email2 ⇒ Object
Returns the value of attribute email2.
-
#email3 ⇒ Object
Returns the value of attribute email3.
-
#email4 ⇒ Object
Returns the value of attribute email4.
-
#email5 ⇒ Object
Returns the value of attribute email5.
-
#email6 ⇒ Object
Returns the value of attribute email6.
-
#email7 ⇒ Object
Returns the value of attribute email7.
-
#firstName ⇒ Object
Returns the value of attribute firstName.
-
#fullName ⇒ Object
Returns the value of attribute fullName.
-
#homeCity ⇒ Object
Returns the value of attribute homeCity.
-
#homeCountry ⇒ Object
Returns the value of attribute homeCountry.
-
#homeFax ⇒ Object
Returns the value of attribute homeFax.
-
#homePhone ⇒ Object
Returns the value of attribute homePhone.
-
#homePostalCode ⇒ Object
Returns the value of attribute homePostalCode.
-
#homeState ⇒ Object
Returns the value of attribute homeState.
-
#homeStreet ⇒ Object
Returns the value of attribute homeStreet.
-
#homeURL ⇒ Object
Returns the value of attribute homeURL.
-
#id ⇒ Object
Returns the value of attribute id.
-
#imAddress1 ⇒ Object
Returns the value of attribute imAddress1.
-
#imAddress2 ⇒ Object
Returns the value of attribute imAddress2.
-
#imAddress3 ⇒ Object
Returns the value of attribute imAddress3.
-
#imAddress4 ⇒ Object
Returns the value of attribute imAddress4.
-
#imAddress5 ⇒ Object
Returns the value of attribute imAddress5.
-
#image ⇒ Object
Returns the value of attribute image.
-
#jobTitle ⇒ Object
Returns the value of attribute jobTitle.
-
#l ⇒ Object
Returns the value of attribute l.
-
#lastName ⇒ Object
Returns the value of attribute lastName.
-
#maidenName ⇒ Object
Returns the value of attribute maidenName.
-
#middleName ⇒ Object
Returns the value of attribute middleName.
-
#mobilePhone ⇒ Object
Returns the value of attribute mobilePhone.
-
#name ⇒ Object
Returns the value of attribute name.
-
#namePrefix ⇒ Object
Returns the value of attribute namePrefix.
-
#nameSuffix ⇒ Object
Returns the value of attribute nameSuffix.
-
#nickname ⇒ Object
Returns the value of attribute nickname.
-
#notes ⇒ Object
Returns the value of attribute notes.
-
#otherCity ⇒ Object
Returns the value of attribute otherCity.
-
#otherCountry ⇒ Object
Returns the value of attribute otherCountry.
-
#otherFax ⇒ Object
Returns the value of attribute otherFax.
-
#otherPhone ⇒ Object
Returns the value of attribute otherPhone.
-
#otherPostalCode ⇒ Object
Returns the value of attribute otherPostalCode.
-
#otherState ⇒ Object
Returns the value of attribute otherState.
-
#otherStreet ⇒ Object
Returns the value of attribute otherStreet.
-
#otherURL ⇒ Object
Returns the value of attribute otherURL.
-
#pager ⇒ Object
Returns the value of attribute pager.
-
#shared_account_id ⇒ Object
Returns the value of attribute shared_account_id.
-
#shared_folder_account_id ⇒ Object
Returns the value of attribute shared_folder_account_id.
-
#tn ⇒ Object
Returns the value of attribute tn.
-
#type ⇒ Object
Returns the value of attribute type.
-
#workCity ⇒ Object
Returns the value of attribute workCity.
-
#workCountry ⇒ Object
Returns the value of attribute workCountry.
-
#workFax ⇒ Object
Returns the value of attribute workFax.
-
#workPhone ⇒ Object
Returns the value of attribute workPhone.
-
#workPostalCode ⇒ Object
Returns the value of attribute workPostalCode.
-
#workState ⇒ Object
Returns the value of attribute workState.
-
#workStreet ⇒ Object
Returns the value of attribute workStreet.
-
#workURL ⇒ Object
Returns the value of attribute workURL.
Attributes inherited from Base::Object
Instance Method Summary collapse
- #add_custom_property(key, value) ⇒ Object
- #create! ⇒ Object
- #delete! ⇒ Object
- #emails ⇒ Object
- #group? ⇒ Boolean
-
#initialize(parent) ⇒ Contact
constructor
A new instance of Contact.
- #modify! ⇒ Object
- #reload! ⇒ Object
- #rename!(*args) ⇒ Object
- #update!(hash) ⇒ Object
Methods included from BelongsToTag
Methods included from BelongsToFolder
#folder, #folder!, #folder=, #folder_id, #move!, #trash!
Methods inherited from Base::Object
#clone, #inspect, #instance_variables_map, #logger, #recorded?, #save!, #to_h, #to_s, #update_attribute
Constructor Details
#initialize(parent) ⇒ Contact
Returns a new instance of Contact.
15 16 17 18 19 20 |
# File 'lib/zm/client/contact/contact.rb', line 15 def initialize(parent) @l = FolderDefault::CONTACTS[:id] @shared_account_id = nil @shared_folder_account_id = nil super(parent) end |
Instance Attribute Details
#anniversary ⇒ Object
Returns the value of attribute anniversary.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def anniversary @anniversary end |
#assistantPhone ⇒ Object
Returns the value of attribute assistantPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def assistantPhone @assistantPhone end |
#birthday ⇒ Object
Returns the value of attribute birthday.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def birthday @birthday end |
#callbackPhone ⇒ Object
Returns the value of attribute callbackPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def callbackPhone @callbackPhone end |
#carPhone ⇒ Object
Returns the value of attribute carPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def carPhone @carPhone end |
#company ⇒ Object
Returns the value of attribute company.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def company @company end |
#companyPhone ⇒ Object
Returns the value of attribute companyPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def companyPhone @companyPhone end |
#custom1 ⇒ Object
Returns the value of attribute custom1.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def custom1 @custom1 end |
#department ⇒ Object
Returns the value of attribute department.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def department @department end |
#email ⇒ Object
Returns the value of attribute email.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email @email end |
#email2 ⇒ Object
Returns the value of attribute email2.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email2 @email2 end |
#email3 ⇒ Object
Returns the value of attribute email3.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email3 @email3 end |
#email4 ⇒ Object
Returns the value of attribute email4.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email4 @email4 end |
#email5 ⇒ Object
Returns the value of attribute email5.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email5 @email5 end |
#email6 ⇒ Object
Returns the value of attribute email6.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email6 @email6 end |
#email7 ⇒ Object
Returns the value of attribute email7.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def email7 @email7 end |
#firstName ⇒ Object
Returns the value of attribute firstName.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def firstName @firstName end |
#fullName ⇒ Object
Returns the value of attribute fullName.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def fullName @fullName end |
#homeCity ⇒ Object
Returns the value of attribute homeCity.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeCity @homeCity end |
#homeCountry ⇒ Object
Returns the value of attribute homeCountry.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeCountry @homeCountry end |
#homeFax ⇒ Object
Returns the value of attribute homeFax.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeFax @homeFax end |
#homePhone ⇒ Object
Returns the value of attribute homePhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homePhone @homePhone end |
#homePostalCode ⇒ Object
Returns the value of attribute homePostalCode.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homePostalCode @homePostalCode end |
#homeState ⇒ Object
Returns the value of attribute homeState.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeState @homeState end |
#homeStreet ⇒ Object
Returns the value of attribute homeStreet.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeStreet @homeStreet end |
#homeURL ⇒ Object
Returns the value of attribute homeURL.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def homeURL @homeURL end |
#id ⇒ Object
Returns the value of attribute id.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def id @id end |
#imAddress1 ⇒ Object
Returns the value of attribute imAddress1.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def imAddress1 @imAddress1 end |
#imAddress2 ⇒ Object
Returns the value of attribute imAddress2.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def imAddress2 @imAddress2 end |
#imAddress3 ⇒ Object
Returns the value of attribute imAddress3.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def imAddress3 @imAddress3 end |
#imAddress4 ⇒ Object
Returns the value of attribute imAddress4.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def imAddress4 @imAddress4 end |
#imAddress5 ⇒ Object
Returns the value of attribute imAddress5.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def imAddress5 @imAddress5 end |
#image ⇒ Object
Returns the value of attribute image.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def image @image end |
#jobTitle ⇒ Object
Returns the value of attribute jobTitle.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def jobTitle @jobTitle end |
#l ⇒ Object
Returns the value of attribute l.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def l @l end |
#lastName ⇒ Object
Returns the value of attribute lastName.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def lastName @lastName end |
#maidenName ⇒ Object
Returns the value of attribute maidenName.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def maidenName @maidenName end |
#middleName ⇒ Object
Returns the value of attribute middleName.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def middleName @middleName end |
#mobilePhone ⇒ Object
Returns the value of attribute mobilePhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def mobilePhone @mobilePhone end |
#name ⇒ Object
Returns the value of attribute name.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def name @name end |
#namePrefix ⇒ Object
Returns the value of attribute namePrefix.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def namePrefix @namePrefix end |
#nameSuffix ⇒ Object
Returns the value of attribute nameSuffix.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def nameSuffix @nameSuffix end |
#nickname ⇒ Object
Returns the value of attribute nickname.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def nickname @nickname end |
#notes ⇒ Object
Returns the value of attribute notes.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def notes @notes end |
#otherCity ⇒ Object
Returns the value of attribute otherCity.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherCity @otherCity end |
#otherCountry ⇒ Object
Returns the value of attribute otherCountry.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherCountry @otherCountry end |
#otherFax ⇒ Object
Returns the value of attribute otherFax.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherFax @otherFax end |
#otherPhone ⇒ Object
Returns the value of attribute otherPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherPhone @otherPhone end |
#otherPostalCode ⇒ Object
Returns the value of attribute otherPostalCode.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherPostalCode @otherPostalCode end |
#otherState ⇒ Object
Returns the value of attribute otherState.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherState @otherState end |
#otherStreet ⇒ Object
Returns the value of attribute otherStreet.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherStreet @otherStreet end |
#otherURL ⇒ Object
Returns the value of attribute otherURL.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def otherURL @otherURL end |
#pager ⇒ Object
Returns the value of attribute pager.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def pager @pager end |
#shared_account_id ⇒ Object
Returns the value of attribute shared_account_id.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def shared_account_id @shared_account_id end |
#shared_folder_account_id ⇒ Object
Returns the value of attribute shared_folder_account_id.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def shared_folder_account_id @shared_folder_account_id end |
#tn ⇒ Object
Returns the value of attribute tn.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def tn @tn end |
#type ⇒ Object
Returns the value of attribute type.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def type @type end |
#workCity ⇒ Object
Returns the value of attribute workCity.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workCity @workCity end |
#workCountry ⇒ Object
Returns the value of attribute workCountry.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workCountry @workCountry end |
#workFax ⇒ Object
Returns the value of attribute workFax.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workFax @workFax end |
#workPhone ⇒ Object
Returns the value of attribute workPhone.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workPhone @workPhone end |
#workPostalCode ⇒ Object
Returns the value of attribute workPostalCode.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workPostalCode @workPostalCode end |
#workState ⇒ Object
Returns the value of attribute workState.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workState @workState end |
#workStreet ⇒ Object
Returns the value of attribute workStreet.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workStreet @workStreet end |
#workURL ⇒ Object
Returns the value of attribute workURL.
12 13 14 |
# File 'lib/zm/client/contact/contact.rb', line 12 def workURL @workURL end |
Instance Method Details
#add_custom_property(key, value) ⇒ Object
30 31 32 |
# File 'lib/zm/client/contact/contact.rb', line 30 def add_custom_property(key, value) instance_variable_set(Utils.arrow_name(key), value) end |
#create! ⇒ Object
34 35 36 37 38 39 |
# File 'lib/zm/client/contact/contact.rb', line 34 def create! rep = @parent.sacc.invoke(jsns_builder.to_jsns) ContactJsnsInitializer.update(self, rep[:CreateContactResponse][:cn].first) @id end |
#delete! ⇒ Object
62 63 64 65 66 67 |
# File 'lib/zm/client/contact/contact.rb', line 62 def delete! return false if @id.nil? @parent.sacc.invoke(jsns_builder.to_delete) @id = nil end |
#emails ⇒ Object
26 27 28 |
# File 'lib/zm/client/contact/contact.rb', line 26 def emails [email, email2, email3, email4, email5, email6, email7].compact end |
#group? ⇒ Boolean
22 23 24 |
# File 'lib/zm/client/contact/contact.rb', line 22 def group? @type == GROUP_PATTERN end |
#modify! ⇒ Object
41 42 43 44 |
# File 'lib/zm/client/contact/contact.rb', line 41 def modify! @parent.sacc.invoke(jsns_builder.to_update) true end |
#reload! ⇒ Object
69 70 71 |
# File 'lib/zm/client/contact/contact.rb', line 69 def reload! raise NotImplementedError end |
#rename!(*args) ⇒ Object
58 59 60 |
# File 'lib/zm/client/contact/contact.rb', line 58 def rename!(*args) raise NotImplementedError end |
#update!(hash) ⇒ Object
46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/zm/client/contact/contact.rb', line 46 def update!(hash) return false if hash.delete_if { |k, v| v.nil? || !respond_to?(k) }.empty? do_update!(hash) hash.each do |key, value| update_attribute(key, value) end true end |