Module: Croudia::API::Users

Included in:
Client
Defined in:
lib/croudia/api/users.rb

Instance Method Summary collapse

Instance Method Details

#user(user, params = {}) ⇒ Croudia::User #user(params = {}) ⇒ Croudia::User

Retrieve a user

Overloads:

  • #user(user, params = {}) ⇒ Croudia::User

    Parameters:

    • user (String, Integer, Croudia::User)
    • params (Hash) (defaults to: {})

      Additional query parameters

  • #user(params = {}) ⇒ Croudia::User

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :screen_name (String)

      Screen name of the user

    • :user_id (String, Integer)

      ID of the user

Returns:

See Also:



17
18
19
20
21
# File 'lib/croudia/api/users.rb', line 17

def user(user, params={})
  merge_user!(params, user)
  resp = get('/users/show.json', params)
  Croudia::User.new(resp)
end

#users(*users, params = {}) ⇒ Array<Croudia::User> #users(params = {}) ⇒ Array<Croudia::User>

Lookup Users

Overloads:

  • #users(*users, params = {}) ⇒ Array<Croudia::User>

    Parameters:

    • users (String, Integer, Croudia::User)
    • params (Hash) (defaults to: {})

      Additional query parameters

  • #users(params = {}) ⇒ Array<Croudia::User>

    Parameters:

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

      Query parameters

    Options Hash (params):

    • :screen_name (String)

      Comma-separated screen names

    • :user_id (String)

      Comma-separated user IDs

Returns:

See Also:



34
35
36
37
38
# File 'lib/croudia/api/users.rb', line 34

def users(*args)
  merge_users!(params = {}, args)
  resp = get('/users/lookup.json', params)
  objects(Croudia::User, resp)
end