lib/omnicontacts/importer/gmail.rb in omnicontacts-0.1.5 vs lib/omnicontacts/importer/gmail.rb in omnicontacts-0.1.6

- old
+ new

@@ -16,22 +16,22 @@ @contacts_host = "www.google.com" @contacts_path = "/m8/feeds/contacts/default/full" end def fetch_contacts_using_access_token access_token, token_type - contacts_response = https_get(@contacts_host, @contacts_path, contacts_req_params, contacts_req_headers(access_token, token_type)) + contacts_response = https_get(@contacts_host, @contacts_path, contacts_req_params, contacts_req_headers(access_token, token_type)) parse_contacts contacts_response end - private + private def contacts_req_params - { "max-results" => "100"} + {"max-results" => "100"} end def contacts_req_headers token, token_type - {"GData-Version" => "3.0", "Authorization" => "#{token_type} #{token}"} + {"GData-Version" => "3.0", "Authorization" => "#{token_type} #{token}"} end def parse_contacts contacts_as_xml xml = REXML::Document.new(contacts_as_xml) contacts = [] @@ -44,10 +44,10 @@ contact[:name] = gd_name.elements['gd:fullName'].text end contacts << contact end end - contacts + contacts end end end end