Class: Lyft::OAuthClient

Inherits:
NetHTTPClient
  • Object
show all
Defined in:
lib/lyft/client.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

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(options={})
  raise unless options.has_key? :access_token
  @access_token = options[:access_token]
  @oauth_uri = URI.parse(options[:api_url] || Lyft::BASE_URL)
  super(@oauth_uri, options)
end

Instance Attribute Details

#access_tokenObject

Returns the value of attribute access_token.



14
15
16
# File 'lib/lyft/client.rb', line 14

def access_token
  @access_token
end

#refresh_tokenObject

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

Raises:

  • (NotImplementedError)


26
27
28
# File 'lib/lyft/client.rb', line 26

def authorize!(redirect_url, params = {})
  raise NotImplementedError
end