Class: Withings::Api::RequestTokenResponse
- Inherits:
-
Object
- Object
- Withings::Api::RequestTokenResponse
- Defined in:
- lib/withings-api/oauth_base.rb
Overview
Simple wrapper class that encapsulates the results of a call to StaticHelpers#create_request_token
Instance Attribute Summary collapse
-
#oauth_request_token ⇒ Object
Returns the value of attribute oauth_request_token.
Instance Method Summary collapse
-
#authorization_url ⇒ String
URL to redirect the user to to authorize the access to their data.
-
#initialize(oauth_request_token) ⇒ RequestTokenResponse
constructor
A new instance of RequestTokenResponse.
-
#oauth_consumer ⇒ Object
:nodoc:.
- #request_token ⇒ RequestToken
-
#secret ⇒ String
The OAuth request token secret.
-
#token ⇒ String
(also: #key)
The OAuth request token key.
Constructor Details
#initialize(oauth_request_token) ⇒ RequestTokenResponse
Returns a new instance of RequestTokenResponse.
63 64 65 |
# File 'lib/withings-api/oauth_base.rb', line 63 def initialize(oauth_request_token) self.oauth_request_token = oauth_request_token end |
Instance Attribute Details
#oauth_request_token ⇒ Object
Returns the value of attribute oauth_request_token.
89 90 91 |
# File 'lib/withings-api/oauth_base.rb', line 89 def oauth_request_token @oauth_request_token end |
Instance Method Details
#authorization_url ⇒ String
Returns URL to redirect the user to to authorize the access to their data.
80 81 82 |
# File 'lib/withings-api/oauth_base.rb', line 80 def self.oauth_request_token. end |
#oauth_consumer ⇒ Object
:nodoc:
92 93 94 |
# File 'lib/withings-api/oauth_base.rb', line 92 def oauth_consumer self.oauth_request_token.consumer end |
#request_token ⇒ RequestToken
85 86 87 |
# File 'lib/withings-api/oauth_base.rb', line 85 def request_token RequestToken.new(self.key, self.secret) end |
#secret ⇒ String
Returns the OAuth request token secret.
75 76 77 |
# File 'lib/withings-api/oauth_base.rb', line 75 def secret self.oauth_request_token.secret end |
#token ⇒ String Also known as: key
Returns the OAuth request token key.
68 69 70 |
# File 'lib/withings-api/oauth_base.rb', line 68 def token self.oauth_request_token.token end |