Class: FileConvert::Client
- Inherits:
-
Google::APIClient
- Object
- Google::APIClient
- FileConvert::Client
- Defined in:
- lib/file_convert/client.rb
Constant Summary collapse
- APP_OPTIONS =
{ application_name: 'file-convert', application_version: FileConvert::Version::STRING }
Instance Attribute Summary collapse
-
#drive ⇒ Object
readonly
Returns the value of attribute drive.
Instance Method Summary collapse
-
#initialize ⇒ FileConvert::Client
constructor
Inherits from Google::APIClient Basically wraps authentiation for simple configuration.
Constructor Details
#initialize ⇒ FileConvert::Client
Inherits from Google::APIClient Basically wraps authentiation for simple configuration
17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/file_convert/client.rb', line 17 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' asserter = get_asserter gaccount['email'], gaccount['auth_url'], key super(APP_OPTIONS).tap do |client| client. = asserter. @drive = client.discovered_api('drive', 'v2') end end |
Instance Attribute Details
#drive ⇒ Object (readonly)
Returns the value of attribute drive.
10 11 12 |
# File 'lib/file_convert/client.rb', line 10 def drive @drive end |