module SparkApi::Authentication::OAuth2Impl

OAuth2 authentication flow to refresh an access token

Public Class Methods

load_provider(string, args={}) click to toggle source

Loads a provider class from a string

# File lib/spark_api/authentication/oauth2.rb, line 264
def self.load_provider(string, args={})
  constant = Object
  string.split("::").compact.each { |name| constant = constant.const_get(name) unless name == ""}
  constant.new(args)
rescue => e
  raise ArgumentError, "The value '#{string}' is an invalid class name for an oauth2 provider:  #{e.message}"
end