Class: Withings::Api::RequestTokenResponse

Inherits:
Object
  • Object
show all
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

Instance Method Summary collapse

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_tokenObject

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_urlString

Returns URL to redirect the user to to authorize the access to their data.

Returns:

  • (String)

    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 authorization_url
  self.oauth_request_token.authorize_url
end

#oauth_consumerObject

:nodoc:



92
93
94
# File 'lib/withings-api/oauth_base.rb', line 92

def oauth_consumer
  self.oauth_request_token.consumer
end

#request_tokenRequestToken

Returns:



85
86
87
# File 'lib/withings-api/oauth_base.rb', line 85

def request_token
  RequestToken.new(self.key, self.secret)
end

#secretString

Returns the OAuth request token secret.

Returns:

  • (String)

    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

#tokenString Also known as: key

Returns the OAuth request token key.

Returns:

  • (String)

    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