Module: Gplus::Activity

Included in:
Client
Defined in:
lib/gplus/activity.rb

Overview

A collection of methods for Google+ Activities API calls.

Instance Method Summary collapse

Instance Method Details

#get_activity(id) ⇒ Hash

Get an Activity by its unique ID.

Parameters:

  • id (String)

    The unique ID of the activity you want to retrieve.

Returns:

See Also:



10
11
12
# File 'lib/gplus/activity.rb', line 10

def get_activity(id)
  get("activities/#{id}")
end

#list_activities(person_id, options = {}) ⇒ Hash

List a Person's Google+ activities.

Parameters:

  • person_id (String)

    The unique ID of the person whose activities you want to list. Pass the string 'me' to list the activities for the person that the API client is authorized as.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • maxResults (Integer) — default: 20

    The number of activities, between 1 and 100, to return.

  • pageToken (String)

    The page of activities to fetch. Pass the value of :nextPageToken from the previous result set to get the next page of results.

Returns:

See Also:



22
23
24
# File 'lib/gplus/activity.rb', line 22

def list_activities(person_id, options = {})
  get("people/#{person_id}/activities/public", options)
end

#search_activities(query, options = {}) ⇒ Hash

Search all public Google+ activities.

Parameters:

  • query (String)

    The full text query to search for.

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • maxResults (Integer) — default: 10

    The number of activities, between 1 and 20, to return.

  • pageToken (String)

    The page of activities to fetch. Pass the value of :nextPageToken from the previous result set to get the next page of results.

  • orderBy (String) — default: 'recent'

    Specifies how to order search results. Acceptable values are 'best' and 'recent'.

Returns:

See Also:



34
35
36
# File 'lib/gplus/activity.rb', line 34

def search_activities(query, options = {})
  get("activities", options.merge(:query => query))
end