Class: Contacts::Provider::Yahoo

Inherits:
OAuth
  • Object
show all
Defined in:
lib/contacts/provider/yahoo.rb

Instance Method Summary collapse

Methods inherited from OAuth

#connect!, #consumer, inherited

Methods inherited from Base

all, #attributes, #attributes=, #connect!, #connection, #contacts, #contacts_response, #initialize, #parse_attributes, provider_id, #site_url, #valid_attributes, valid_attributes, valid_attributes=

Constructor Details

This class inherits a constructor from Contacts::Provider::Base

Instance Method Details

#parse_contacts!Object



9
10
11
# File 'lib/contacts/provider/yahoo.rb', line 9

def parse_contacts!
  @contacts = ((MultiJson.decode(contacts_response.body)['contacts']||{})['contact']||[]).map { |contact| Contacts::Contact::Yahoo.parse(contact) }.compact
end

#retrieve_contacts!Object



5
6
7
# File 'lib/contacts/provider/yahoo.rb', line 5

def retrieve_contacts!
  @contacts_response = connection.get("/v1/user/me/contacts?format=json")
end