Module: CSVPlusPlus::GoogleApiClient
- Defined in:
- lib/csv_plus_plus/google_api_client.rb
Overview
A convenience wrapper around Google’s REST API client
Class Method Summary collapse
-
.drive_client ⇒ Google::Apis::DriveV3::DriveService
Get a
::Google::Apis::DriveV3::DriveServiceinstance connected to the drive API. -
.sheets_client ⇒ Google::Apis::SheetsV4::SheetsService
Get a
::Google::Apis::SheetsV4::SheetsServiceinstance connected to the sheets API.
Class Method Details
.drive_client ⇒ Google::Apis::DriveV3::DriveService
Get a ::Google::Apis::DriveV3::DriveService instance connected to the drive API
18 19 20 21 22 |
# File 'lib/csv_plus_plus/google_api_client.rb', line 18 def self.drive_client ::Google::Apis::DriveV3::DriveService.new.tap do |d| d. = ::Google::Auth.get_application_default(['https://www.googleapis.com/auth/drive.file'].freeze) end end |
.sheets_client ⇒ Google::Apis::SheetsV4::SheetsService
Get a ::Google::Apis::SheetsV4::SheetsService instance connected to the sheets API
9 10 11 12 13 |
# File 'lib/csv_plus_plus/google_api_client.rb', line 9 def self.sheets_client ::Google::Apis::SheetsV4::SheetsService.new.tap do |s| s. = ::Google::Auth.get_application_default(['https://www.googleapis.com/auth/spreadsheets'].freeze) end end |