class Genomelink::Oauth
Oauth
class to take care of the Oauth
2.0 with genomelink APIs
@author [ashwin]
Public Class Methods
get_token(auth_code)
click to toggle source
get_token
description-
@param auth_code [String] This is the code that is returned after use visits and authorizes on the authorization URL
@return [String] Access token that can be used to access the genomelink API.
# File lib/genomelink/oauth.rb, line 22 def get_token(auth_code) client.auth_code.get_token(auth_code, redirect_uri: get_config('GENOMELINK_CALLBACK_URL')).token end
Private Class Methods
client()
click to toggle source
get_config(config_name)
click to toggle source
gets a gicen env variable, checks for existence and throws exception if not present @param config_name [String] key of the env variable
@return [String] value of the env variable
# File lib/genomelink/oauth.rb, line 41 def get_config(config_name) raise ConfigNotFound, "Environment variable #{config_name} not found !" unless ENV[config_name] ENV[config_name] end