class Gapic::Rest::FaradayMiddleware::GoogleAuthorization

def initialize app, credentials

Parameters:
  • credentials (Google::Auth::Credentials, Signet::OAuth2::Client, Symbol, Proc) --
  • app (#call) --

Other tags:
    Private: -
def initialize app, credentials
  @updater_proc = case credentials
                  when Symbol
                    credentials
                  else
                    updater_proc = credentials.updater_proc if credentials.respond_to? :updater_proc
                    updater_proc ||= credentials if credentials.is_a? Proc
                    raise ArgumentError, "invalid credentials (#{credentials.class})" if updater_proc.nil?
                    updater_proc
                  end
  super app
end