class Strava::OAuth::Client
Public Class Methods
config()
click to toggle source
# File lib/strava/oauth/client.rb, line 64 def config Config end
configure() { |Config| ... }
click to toggle source
# File lib/strava/oauth/client.rb, line 60 def configure block_given? ? yield(Config) : Config end
new(options = {})
click to toggle source
Calls superclass method
Strava::Web::Client::new
# File lib/strava/oauth/client.rb, line 6 def initialize(options = {}) Strava::OAuth::Config::ATTRIBUTES.each do |key| send("#{key}=", options[key] || Strava::OAuth.config.send(key)) end super end
Public Instance Methods
oauth_token(options = {})
click to toggle source
Complete the authentication process.
@option options [Object] :code
The code parameter obtained in the redirect.
@option options [Object] :grant_type
The grant type for the request.
@see developers.strava.com/docs/authentication/ @return [Hash] Token information.
# File lib/strava/oauth/client.rb, line 49 def oauth_token(options = {}) query = options.merge( client_id: client_id || raise(ArgumentError, 'Missing Strava client id.'), client_secret: client_secret || raise(ArgumentError, 'Missing Strava client secret.'), grant_type: options[:grant_type] || 'authorization_code' ) Strava::Models::Token.new(post('token', query)) end