Class: Vkontakte::App::User
Overview
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
Instance Attribute Summary collapse
Attributes inherited from Base
#auth
Class Method Summary
collapse
Instance Method Summary
collapse
included
included
included
included
included
included
Methods inherited from Base
#authorize, #authorized?, #call
Constructor Details
#initialize(identifier, options = {}) ⇒ User
Returns a new instance of User.
22
23
24
25
26
27
|
# File 'lib/vkontakte/app/user.rb', line 22
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
|
Instance Attribute Details
#identifier ⇒ Object
Returns the value of attribute identifier.
20
21
22
|
# File 'lib/vkontakte/app/user.rb', line 20
def identifier
@identifier
end
|
Class Method Details
.fetch(identifier, options = {}) ⇒ Object
44
45
46
|
# File 'lib/vkontakte/app/user.rb', line 44
def self.fetch(identifier, options = {})
new(identifier, options).fetch
end
|
Instance Method Details
#fetch(options = {}) ⇒ Object
29
30
31
32
|
# File 'lib/vkontakte/app/user.rb', line 29
def fetch(options = {})
options = { :uids => @identifier }.merge(options)
profile.get( options )
end
|
#fetch_followers(options = {}) ⇒ Object
34
35
36
37
|
# File 'lib/vkontakte/app/user.rb', line 34
def fetch_followers(options = {})
options = { :user_id => @identifier }.merge(options)
profile.getFollowers(options)
end
|
#fetch_friends(options = {}) ⇒ Object
39
40
41
42
|
# File 'lib/vkontakte/app/user.rb', line 39
def fetch_friends(options = {})
options = { :user_id => @identifier }.merge(options)
friends.get(options)
end
|