Class: SocialOauthApi::Sinaweibo::User

Inherits:
Object
  • Object
show all
Includes:
Base, Config
Defined in:
lib/social_oauth_api/sinaweibo/sinaweibo_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

#show_url, #uid_url

Methods included from Base

#get, #initialize, klass

Instance Method Details

#profile_image_urlObject Also known as: image_url



24
25
26
# File 'lib/social_oauth_api/sinaweibo/sinaweibo_user.rb', line 24

def profile_image_url
  show['profile_image_url']
end

#screen_nameObject Also known as: name



20
21
22
# File 'lib/social_oauth_api/sinaweibo/sinaweibo_user.rb', line 20

def screen_name
  show['screen_name']
end

#showObject Also known as: user_info



14
15
16
17
18
# File 'lib/social_oauth_api/sinaweibo/sinaweibo_user.rb', line 14

def show
  @user_info ||= JSON.parse(
    get(show_url, access_token: access_token, uid: uid)
  )
end

#uidObject Also known as: id



9
10
11
12
# File 'lib/social_oauth_api/sinaweibo/sinaweibo_user.rb', line 9

def uid
  @uid ||= JSON.parse(get(uid_url, access_token: access_token))
  @uid['uid'].to_s
end