class Munchsrb::Exporter::GoogleClient

Munchsrb::Exporter::GoogleClient is shared client to access google apis.

Constants

SCOPES

Public Class Methods

session() click to toggle source
# File lib/munchsrb/exporter/google_client.rb, line 15
def session
  GoogleDrive::Session.from_credentials(credentials)
end

Private Class Methods

credentials() click to toggle source
# File lib/munchsrb/exporter/google_client.rb, line 21
def credentials
  ::Google::Auth::UserRefreshCredentials.new(
    client_id: ENV['GOOGLE_CLIENT'],
    client_secret: ENV['GOOGLE_CLIENT_SECRET'],
    refresh_token: ENV['GOOGLE_REFRESH_TOKEN'],
    scope: SCOPES,
    redirect_uri: 'urn:ietf:wg:oauth:2.0:oob'
  )
end