Module: Sorcery::Controller::Submodules::Oauth::Providers::Twitter::TwitterClient
- Extended by:
- Oauth1
- Defined in:
- lib/sorcery/controller/submodules/oauth/providers/twitter.rb
Class Attribute Summary collapse
-
.callback_url ⇒ Object
Returns the value of attribute callback_url.
-
.key ⇒ Object
Returns the value of attribute key.
-
.secret ⇒ Object
Returns the value of attribute secret.
-
.site ⇒ Object
Returns the value of attribute site.
-
.user_info_mapping ⇒ Object
Returns the value of attribute user_info_mapping.
-
.user_info_path ⇒ Object
Returns the value of attribute user_info_path.
Class Method Summary collapse
Methods included from Oauth1
authorize_url, get_access_token, get_request_token, oauth_version
Class Attribute Details
.callback_url ⇒ Object
Returns the value of attribute callback_url.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def callback_url @callback_url end |
.key ⇒ Object
Returns the value of attribute key.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def key @key end |
.secret ⇒ Object
Returns the value of attribute secret.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def secret @secret end |
.site ⇒ Object
Returns the value of attribute site.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def site @site end |
.user_info_mapping ⇒ Object
Returns the value of attribute user_info_mapping.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def user_info_mapping @user_info_mapping end |
.user_info_path ⇒ Object
Returns the value of attribute user_info_path.
31 32 33 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 31 def user_info_path @user_info_path end |
Class Method Details
.get_user_hash(access_token) ⇒ Object
46 47 48 49 50 51 52 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 46 def get_user_hash(access_token) user_hash = {} response = access_token.get(@user_info_path) user_hash[:user_info] = JSON.parse(response.body) user_hash[:uid] = user_hash[:user_info]['id'] user_hash end |
.init ⇒ Object
40 41 42 43 44 |
# File 'lib/sorcery/controller/submodules/oauth/providers/twitter.rb', line 40 def init @site = "https://api.twitter.com" @user_info_path = "/1/account/verify_credentials.json" @user_info_mapping = {} end |