Sha256: 9e1b3d251c92ed654b88729b76214522f069e604c2bd0b9b7416187ad6973731
Contents?: true
Size: 1.27 KB
Versions: 3
Compression:
Stored size: 1.27 KB
Contents
module Vkontakte module App # Vkontakte user # # user = Vkontakte::App::User.fetch(uid, :access_token => ACCESS_TOKEN) # # or # # user = Vkontakte::App::User.new(uid, :access_token => ACCESS_TOKEN) # user.fetch # class User < Base include Api::Photos include Api::Friends include Api::Groups include Api::Profile include Api::Wall include Api::Likes attr_reader :identifier def initialize(identifier, options = {}) super(options[:app_id], options[:app_secret]) @identifier = identifier @auth = { 'access_token' => options[:access_token] } if options.has_key?(:access_token) photos.default_params = { :uid => @identifier } end def fetch(options = {}) options = { :uids => @identifier }.merge(options) profile.get( options ) end def fetch_followers(options = {}) options = { :user_id => @identifier }.merge(options) profile.getFollowers(options) end def fetch_friends(options = {}) options = { :user_id => @identifier }.merge(options) friends.get(options) end def self.fetch(identifier, options = {}) new(identifier, options).fetch end end end end
Version data entries
3 entries across 3 versions & 1 rubygems
Version | Path |
---|---|
vkontakte-0.0.8 | lib/vkontakte/app/user.rb |
vkontakte-0.0.7 | lib/vkontakte/app/user.rb |
vkontakte-0.0.6 | lib/vkontakte/app/user.rb |