Class: SocialOauthApi::Qqdenglu::User
- Inherits:
-
Object
- Object
- SocialOauthApi::Qqdenglu::User
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
27
28
29
|
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 27
def figureurl
user_info['figureurl']
end
|
#nickname ⇒ Object
Also known as:
name
23
24
25
|
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 23
def nickname
user_info['nickname']
end
|
#open_id ⇒ Object
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_info ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/social_oauth_api/qqdenglu/qqdenglu_user.rb', line 14
def user_info
@user_info ||= JSON.parse(
get(user_info_url,
access_token: access_token,
oauth_consumer_key: client_id,
openid: open_id)
)
end
|