Module: Vk::DSL::Friends

Included in:
Vk::DSL
Defined in:
lib/vk/dsl/friends.rb

Instance Method Summary collapse

Instance Method Details

#get_friends(user_id, options = {}) ⇒ <Fixnum>, <Vk::User>

Friends information

Parameters:

  • user_id (Fixnum)

    user identifier

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

Options Hash (options):

  • :fields (Array<String>) — default: [:user_id, :first_name, :last_name]

    what fields to request

  • :count (Fixnum)

    how many friends to request

  • :offset (Fixnum)

    offset of friends to request

Returns:



13
14
15
16
17
18
19
20
21
# File 'lib/vk/dsl/friends.rb', line 13

def get_friends(user_id, options = {})
  options[:user_id] = user_id

  if options[:fields]
    Vk::Result.new('friends.get', Vk::User, options).all
  else
    request('friends.get', options)['items']
  end
end