class FileConvert::Client
Constants
- APP_OPTIONS
Attributes
drive[R]
Public Class Methods
new()
click to toggle source
Inherits from Google::APIClient Basically wraps authentiation for simple configuration
@return [FileConvert::Client] (inherits from Google::APIClient)
Calls superclass method
# File lib/file_convert/client.rb, line 20 def initialize gaccount = FileConvert.config['google_service_account'] gaccount['auth_url'] ||= 'https://www.googleapis.com/auth/drive' key = load_key gaccount['pkcs12_file_path'], 'notasecret' options = APP_OPTIONS.merge(authorization: get_authorization( gaccount['email'], gaccount['auth_url'], key )) super(options).tap do |client| client.authorization.fetch_access_token! @drive = client.discovered_api 'drive', 'v2' end end
Private Instance Methods
load_key(path, secret)
click to toggle source
# File lib/file_convert/client.rb, line 37 def load_key(path, secret) Google::APIClient::PKCS12.load_key(path, secret) end