Class: SocialProfile::Providers::Vkontakte
- Defined in:
- lib/social_profile/providers/vkontakte.rb
Instance Attribute Summary
Attributes inherited from Base
Instance Method Summary collapse
-
#gender ⇒ Object
Возвращаемые значения: 1 - женский, 2 - мужской, 0 - без указания пола.
- #picture_url ⇒ Object
- #profile_url ⇒ Object
Methods inherited from Base
#access_token, #avatar_url, #birthday, #city_name, #credentials, #email, #extra, #extra?, #first_name, #info, #info?, #initialize, #last_name, #name, #nickname, #provider, #token_expires_at, #uid, #works?
Constructor Details
This class inherits a constructor from SocialProfile::Providers::Base
Instance Method Details
#gender ⇒ Object
Возвращаемые значения: 1 - женский, 2 - мужской, 0 - без указания пола.
22 23 24 |
# File 'lib/social_profile/providers/vkontakte.rb', line 22 def gender @gender ||= (extra('raw_info')['sex'] || 0).to_i end |
#picture_url ⇒ Object
4 5 6 7 8 9 10 11 |
# File 'lib/social_profile/providers/vkontakte.rb', line 4 def picture_url @picture_url ||= begin if auth_hash['extra'] && info = auth_hash['extra']['raw_info'] photo = info['photo_big'] || info['photo_200_orig'] Utils.blank?(photo) ? nil : photo end end end |
#profile_url ⇒ Object
13 14 15 16 17 18 |
# File 'lib/social_profile/providers/vkontakte.rb', line 13 def profile_url @profile_url ||= begin urls = info('urls') urls.nil? ? nil : urls['Vkontakte'] end end |