Sha256: c9dbc63e82308247a3d8dc1de44220a732a2a9113d8c7870297bba300d3acadf

Contents?: true

Size: 736 Bytes

Versions: 1

Compression:

Stored size: 736 Bytes

Contents

require 'vk/exceptions'

module Vk
  module DSL
    module Friends
      # Friends information
      # @param [Fixnum] user_id user identifier
      # @param [Hash] options
      # @option options [Array<String>] :fields ([:user_id, :first_name, :last_name]) what fields to request
      # @option options [Fixnum] :count how many friends to request
      # @option options [Fixnum] :offset offset of friends to request
      # @return [<Fixnum>, <Vk::User>]
      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
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
vk-0.6.5.53 lib/vk/dsl/friends.rb