Module: Gplus::Person

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

Overview

A collection of methods for Google+ People API calls.

See Also:

Instance Method Summary (collapse)

Instance Method Details

- (Hash) get_person(id)

Get a person's Google+ profile. @ developers.google.com/+/api/latest/people/get The Google+ 'People: get' documentation.

Parameters:

  • id (String)

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

Returns:



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

def get_person(id)
  get("people/#{id}")
end

- (Hash) list_people_by_activity(activity_id, collection, options = {})

List all of the people in the specified collection for a particular activity.

Parameters:

  • activity_id (String)

    The ID of the activity to get the list of people for.

  • collection (String)

    The collection of people to list. Acceptable values are 'plusoners' and 'resharers'.

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

    a customizable set of options

Options Hash (options):

  • maxResults (Integer) — default: 20

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

  • pageToken (String)

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

Returns:

See Also:



36
37
38
# File 'lib/gplus/person.rb', line 36

def list_people_by_activity(activity_id, collection, options = {})
  get("activities/#{activity_id}/people/#{collection}", options)
end

- (Hash) search_people(query, options = {})

Search all public Google+ profiles.

Parameters:

  • query (String)

    The full text query to search for.

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

    a customizable set of options

Options Hash (options):

  • language (String)

    The preferred language to search with. See the official list of allowed language codes.

  • maxResults (Integer) — default: 10

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

  • pageToken (String)

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

Returns:

See Also:



23
24
25
# File 'lib/gplus/person.rb', line 23

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