Class: Tact::GoogleContacts::Entry
- Inherits:
-
Object
- Object
- Tact::GoogleContacts::Entry
- Defined in:
- lib/tact/google_client.rb
Instance Attribute Summary collapse
-
#info ⇒ Object
readonly
Returns the value of attribute info.
Class Method Summary collapse
Instance Method Summary collapse
- #emails ⇒ Object
- #first_name ⇒ Object
-
#initialize(info) ⇒ Entry
constructor
A new instance of Entry.
- #last_name ⇒ Object
- #phone_numbers ⇒ Object
Constructor Details
#initialize(info) ⇒ Entry
Returns a new instance of Entry.
13 14 15 |
# File 'lib/tact/google_client.rb', line 13 def initialize(info) @info = info end |
Instance Attribute Details
#info ⇒ Object (readonly)
Returns the value of attribute info.
7 8 9 |
# File 'lib/tact/google_client.rb', line 7 def info @info end |
Class Method Details
.all ⇒ Object
9 10 11 |
# File 'lib/tact/google_client.rb', line 9 def self.all collection end |
Instance Method Details
#emails ⇒ Object
36 37 38 39 40 41 42 |
# File 'lib/tact/google_client.rb', line 36 def emails if info[:emailAddresses] info[:emailAddresses].map do |email_address| Email.new(address: email_address[:value]) end end end |
#first_name ⇒ Object
17 18 19 |
# File 'lib/tact/google_client.rb', line 17 def first_name names[:givenName] end |
#last_name ⇒ Object
21 22 23 |
# File 'lib/tact/google_client.rb', line 21 def last_name names[:familyName] end |
#phone_numbers ⇒ Object
25 26 27 28 29 30 31 32 33 34 |
# File 'lib/tact/google_client.rb', line 25 def phone_numbers if info[:phoneNumbers] info[:phoneNumbers].map do |phone_number| PhoneNumber.new( number: phone_number[:value], kind: phone_number[:type] ) end end end |