Module: AngellistApi::Client::Users

Included in:
AngellistApi::Client
Defined in:
lib/angellist_api/client/users.rb

Overview

Defines methods related to URLs

Instance Method Summary collapse

Instance Method Details

#get_user(id, options = {}) ⇒ Object

Get a user’s information given an id.

Examples:

Get a user’s information given an id.

AngellistApi.get_user(1234, :include_details => 'investor')

Parameters:

  • id (Integer)

    ID of the desired user.



15
16
17
# File 'lib/angellist_api/client/users.rb', line 15

def get_user(id, options={})
  get("1/users/#{id}", options)
end

#get_users(ids) ⇒ Object

Get information for a batch of up to 50 users given a list of user IDs.

Examples:

Get information for a batch of users.

AngellistApi.get_users([1, 2, 3])

Parameters:

  • ids (Array)

    IDs of the users to fetch.



28
29
30
31
# File 'lib/angellist_api/client/users.rb', line 28

def get_users(ids)
  params = { :ids => ids.join(',') }
  get("1/users/batch", params)
end

#meObject

Get the current user’s information. Responds like GET /users/:id.

Examples:

Get the authenticated user’s information.

AngellistApi.me


55
56
57
# File 'lib/angellist_api/client/users.rb', line 55

def me
  get("1/me")
end

#user_roles(id, options = {}) ⇒ Object

Returns the companies that a user has been tagged in. Results are paginated.

Examples:

Get a user’s roles given an id.

AngellistApi.user_roles(1234)

Parameters:

  • id (Integer)

    ID of the desired user.

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

    a customizable set of options

Options Hash (options):

  • :page (Integer)

    Specifies the page of results to retrieve.



70
71
72
# File 'lib/angellist_api/client/users.rb', line 70

def user_roles(id, options={})
  get("1/users/#{id}/roles", options)
end

#user_search(options = {}) ⇒ Object

Search for a user given a URL slug. Responds like GET /users/:id.

Examples:

Search for a user by URL slug.

AngellistApi.user_search(:slug => '500startups')

Parameters:

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

    A customizable set of options.

Options Hash (options):

  • :slug (String)

    The URL slug of the desired user.

  • :md5 (String)

    An md5 hash of the email address of the desired user.



45
46
47
# File 'lib/angellist_api/client/users.rb', line 45

def user_search(options={})
  get("1/users/search", options)
end