Class: Youku::V2::Users

Inherits:
Base
  • Object
show all
Defined in:
lib/youku/v2/users.rb

Defined Under Namespace

Classes: Friendship

Constant Summary collapse

BASE_URI =
"#{BASE_URI}/users"

Instance Attribute Summary

Attributes inherited from Base

#client

Instance Method Summary collapse

Instance Method Details

#friendshipObject

Public: Get favourite API.

Returns the instance of Youku::V2::Users::Friendship.



41
42
43
# File 'lib/youku/v2/users.rb', line 41

def friendship
  Friendship.new(client)
end

#show(user_id: nil, user_name: nil) ⇒ Object

Public: Get user by ID

See: open.youku.com/docs?id=24

user_id - The string of a youku user ID user_name - The string of a youku user name.

Returns the instance of Youku::V2::Request.



30
31
32
33
34
35
36
# File 'lib/youku/v2/users.rb', line 30

def show(user_id: nil, user_name: nil)
  Youku::V2::Request.new "#{BASE_URI}/show.json", {
    client_id: client.client_id,
    user_id:   user_id,
    user_name: user_name,
  }
end

#show_batch(user_ids: nil, user_names: nil) ⇒ Object

Public: Get users by IDs

See: open.youku.com/docs?id=25

user_ids - The comma separated String of user IDs. user_names - The comma separated String of user names.

Returns the instance of Youku::V2::Request.



14
15
16
17
18
19
20
# File 'lib/youku/v2/users.rb', line 14

def show_batch(user_ids: nil, user_names: nil)
  Youku::V2::Request.new "#{BASE_URI}/show_batch.json", {
    client_id:  client.client_id,
    user_ids:   user_ids,
    user_names: user_names,
  }
end