Class: Contacts::Google
- Inherits:
-
OAuthConsumer
- Object
- Consumer
- OAuthConsumer
- Contacts::Google
- Defined in:
- lib/contacts/google.rb
Constant Summary collapse
- CONSUMER_OPTIONS =
Util.frozen_hash( :site => "https://www.google.com", :request_token_path => "/accounts/OAuthGetRequestToken", :access_token_path => "/accounts/OAuthGetAccessToken", :authorize_path => "/accounts/OAuthAuthorizeToken" )
- REQUEST_TOKEN_PARAMS =
Util.frozen_hash( 'scope' => "https://www.google.com/m8/feeds/" )
Instance Attribute Summary
Attributes inherited from OAuthConsumer
Attributes inherited from Consumer
Instance Method Summary collapse
- #contacts(options = {}) ⇒ Object
-
#initialize(options = {}) ⇒ Google
constructor
A new instance of Google.
Methods inherited from OAuthConsumer
#authentication_url, #authorize, #initialize_serialized, #serializable_data
Methods inherited from Consumer
#authorize, configuration, configuration_attribute, configure, deserialize, #serialize
Constructor Details
#initialize(options = {}) ⇒ Google
Returns a new instance of Google.
16 17 18 |
# File 'lib/contacts/google.rb', line 16 def initialize(={}) super(CONSUMER_OPTIONS, REQUEST_TOKEN_PARAMS) end |
Instance Method Details
#contacts(options = {}) ⇒ Object
20 21 22 23 24 25 26 27 |
# File 'lib/contacts/google.rb', line 20 def contacts(={}) return nil if @access_token.nil? params = {:limit => 200}.update() google_params = translate_parameters(params) query = params_to_query(google_params) response = @access_token.get("/m8/feeds/contacts/default/thin?#{query}") parse_contacts(response.body) end |