Class: Lyft::OAuthClient
- Inherits:
-
NetHTTPClient
- Object
- NetHTTPClient
- Lyft::OAuthClient
- Defined in:
- lib/lyft/client.rb
Instance Attribute Summary collapse
-
#access_token ⇒ Object
Returns the value of attribute access_token.
-
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
Instance Method Summary collapse
- #auth_headers(method, path, body) ⇒ Object
- #authorize!(redirect_url, params = {}) ⇒ Object
-
#initialize(options = {}) ⇒ OAuthClient
constructor
A new instance of OAuthClient.
Constructor Details
#initialize(options = {}) ⇒ OAuthClient
Returns a new instance of OAuthClient.
15 16 17 18 19 20 |
# File 'lib/lyft/client.rb', line 15 def initialize(={}) raise unless .has_key? :access_token @access_token = [:access_token] @oauth_uri = URI.parse([:api_url] || Lyft::BASE_URL) super(@oauth_uri, ) end |
Instance Attribute Details
#access_token ⇒ Object
Returns the value of attribute access_token.
14 15 16 |
# File 'lib/lyft/client.rb', line 14 def access_token @access_token end |
#refresh_token ⇒ Object
Returns the value of attribute refresh_token.
14 15 16 |
# File 'lib/lyft/client.rb', line 14 def refresh_token @refresh_token end |
Instance Method Details
#auth_headers(method, path, body) ⇒ Object
22 23 24 |
# File 'lib/lyft/client.rb', line 22 def auth_headers(method, path, body) { 'Authorization' => "Bearer #{@access_token}"} end |
#authorize!(redirect_url, params = {}) ⇒ Object
26 27 28 |
# File 'lib/lyft/client.rb', line 26 def (redirect_url, params = {}) raise NotImplementedError end |