Class: SocialOauthApi::Qqdenglu::User

Inherits:
Object
  • Object
show all
Includes:
Base, Config
Defined in:
lib/social_oauth_api/qqdenglu/qqdenglu_user.rb

Constant Summary

Constants included from Base

Base::HTTP_TIMEOUT

Instance Attribute Summary

Attributes included from Base

#access_token, #client_id, #provider_type

Instance Method Summary collapse

Methods included from Config

#open_id_url, #user_info_url

Methods included from Base

#get, #initialize, klass

Instance Method Details

#figureurlObject Also known as: image_url



27
28
29
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 27

def figureurl
  ['figureurl']
end

#nicknameObject Also known as: name



23
24
25
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 23

def nickname
  ['nickname']
end

#open_idObject Also known as: id



9
10
11
12
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 9

def open_id
  @open_id ||= get(open_id_url, access_token: access_token)
  @open_id.match(/"openid":"(?<openid>\w+)"/)[:openid]
end

#user_infoObject



14
15
16
17
18
19
20
21
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 14

def 
  @user_info ||= JSON.parse(
    get(,
        access_token: access_token,
        oauth_consumer_key: client_id,
        openid: open_id)
  )
end