Class: GoogleContacts::Contact
- Defined in:
- lib/google_contacts/contact.rb
Constant Summary collapse
- CATEGORY_TERM =
'http://schemas.google.com/contact/2008#contact'
Constants inherited from Base
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
- #email ⇒ Object
- #email=(address) ⇒ Object
-
#initialize(*args) ⇒ Contact
constructor
A new instance of Contact.
- #inspect ⇒ Object
Methods inherited from Base
#[], #[]=, #attributes=, #changed?, #delete, #entry_for_batch, feed_for_batch, #href, #insert_xml, #new?, #remove_xml, #save, #updated_at, #url
Constructor Details
#initialize(*args) ⇒ Contact
Returns a new instance of Contact.
6 7 8 9 10 11 12 |
# File 'lib/google_contacts/contact.rb', line 6 def initialize(*args) super register_proxy :emails, Proxies::Emails.new(self) register_proxy :groups, Proxies::Array.new(self, :tag => 'gContact:groupMembershipInfo', :attr => 'href') end |
Dynamic Method Handling
This class handles dynamic methods through the method_missing method in the class GoogleContacts::Base
Instance Method Details
#email ⇒ Object
14 15 16 |
# File 'lib/google_contacts/contact.rb', line 14 def email emails.primary.try(:address) end |
#email=(address) ⇒ Object
18 19 20 |
# File 'lib/google_contacts/contact.rb', line 18 def email=(address) emails[address].primary! end |
#inspect ⇒ Object
22 23 24 |
# File 'lib/google_contacts/contact.rb', line 22 def inspect "\#<GoogleContacts::Contact name=#{name.inspect} email=#{email.inspect}>" end |