Module: CSVPlusPlus::GoogleApiClient
- Extended by:
- T::Sig
- Included in:
- Reader::GoogleSheets, Writer::GoogleSheets
- Defined in:
- lib/csv_plus_plus/google_api_client.rb
Overview
A convenience wrapper around Google’s REST API client
Instance Method Summary collapse
-
#drive_client ⇒ Google::Apis::DriveV3::DriveService
Get a
Google::Apis::DriveV3::DriveService
instance connected to the drive API. -
#sheets_client ⇒ Google::Apis::SheetsV4::SheetsService
Get a
Google::Apis::SheetsV4::SheetsService
instance configured to connect to the sheets API.
Instance Method Details
#drive_client ⇒ Google::Apis::DriveV3::DriveService
Get a Google::Apis::DriveV3::DriveService
instance connected to the drive API
28 29 30 31 32 33 34 35 36 37 |
# File 'lib/csv_plus_plus/google_api_client.rb', line 28 def drive_client ::T.must( @drive_client ||= ::T.let( ::Google::Apis::DriveV3::DriveService.new.tap do |d| d. = ::Google::Auth.get_application_default(['https://www.googleapis.com/auth/drive.file'].freeze) end, ::T.nilable(::Google::Apis::DriveV3::DriveService) ) ) end |
#sheets_client ⇒ Google::Apis::SheetsV4::SheetsService
Get a Google::Apis::SheetsV4::SheetsService
instance configured to connect to the sheets API
13 14 15 16 17 18 19 20 21 22 |
# File 'lib/csv_plus_plus/google_api_client.rb', line 13 def sheets_client ::T.must( @sheets_client ||= ::T.let( ::Google::Apis::SheetsV4::SheetsService.new.tap do |s| s. = ::Google::Auth.get_application_default(['https://www.googleapis.com/auth/spreadsheets'].freeze) end, ::T.nilable(::Google::Apis::SheetsV4::SheetsService) ) ) end |