Sha256: 750444aec0ab955e95019762618e890a80981c7ae543b265f7af09b8c58b1585

Contents?: true

Size: 763 Bytes

Versions: 7

Compression:

Stored size: 763 Bytes

Contents

# encoding: utf-8
module SocialProfile
  module Providers
    class Vkontakte < Base      
      def picture_url
        @picture_url ||= begin
          if auth_hash['extra'] && auth_hash['extra']['raw_info']
            photo = auth_hash['extra']['raw_info']['photo_big']
            Utils.blank?(photo) ? nil : photo
          end
        end
      end
      
      def profile_url
        @profile_url ||= begin
          urls = info('urls')
          urls.nil? ? nil : urls['Vkontakte']
        end
      end
      
      # Возвращаемые значения: 1 - женский, 2 - мужской, 0 - без указания пола. 
      #
      def gender
        @gender ||= (extra('raw_info')['sex'] || 0).to_i
      end
    end
  end  
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
social_profile-0.2.0 lib/social_profile/providers/vkontakte.rb
social_profile-0.1.4 lib/social_profile/providers/vkontakte.rb
social_profile-0.1.3 lib/social_profile/providers/vkontakte.rb
social_profile-0.1.2 lib/social_profile/providers/vkontakte.rb
social_profile-0.1.1 lib/social_profile/providers/vkontakte.rb
social_profile-0.1.0 lib/social_profile/providers/vkontakte.rb
social_profile-0.0.1 lib/social_profile/providers/vkontakte.rb