Module: DriveV3
- Defined in:
- lib/drive_v3.rb,
lib/drive_v3/version.rb,
lib/drive_v3/create_credential.rb
Overview
Unofficial helpers for the Google Drive V3 API
Defined Under Namespace
Classes: CreateCredential
Constant Summary collapse
- VERSION =
The version of this gem
'0.2.1'
Class Method Summary collapse
-
.drive_service(credential_source: nil, scopes: nil, credential_creator: DriveV3::CreateCredential) ⇒ Object
Create a new Google::Apis::DriveV3::DriveService object.
Class Method Details
.drive_service(credential_source: nil, scopes: nil, credential_creator: DriveV3::CreateCredential) ⇒ Object
Create a new Google::Apis::DriveV3::DriveService object
Simplifies creating and configuring a the credential.
43 44 45 46 47 48 49 50 |
# File 'lib/drive_v3.rb', line 43 def drive_service(credential_source: nil, scopes: nil, credential_creator: DriveV3::CreateCredential) credential_source ||= File.read(File.('~/.google-api-credential.json')) scopes ||= [Google::Apis::DriveV3::AUTH_DRIVE] Google::Apis::DriveV3::DriveService.new.tap do |service| service. = credential_creator.call(credential_source, scopes) end end |