Class: PeopleGroup::Connectors::GoogleSheets
- Inherits:
-
Object
- Object
- PeopleGroup::Connectors::GoogleSheets
- Defined in:
- lib/peoplegroup/connectors/google_sheets.rb
Instance Method Summary collapse
-
#spreadsheet(title) ⇒ GoogleDrive::Spreadsheet|nil
Find a spreadsheet by title.
-
#worksheet(spreadsheet_title, worksheet_title) ⇒ GoogleDrive::Worksheet|nil
Find a worksheet by title within a given spreadsheet.
Instance Method Details
#spreadsheet(title) ⇒ GoogleDrive::Spreadsheet|nil
Find a spreadsheet by title.
11 12 13 |
# File 'lib/peoplegroup/connectors/google_sheets.rb', line 11 def spreadsheet(title) retry_on_error { session.spreadsheet_by_title(title) } end |
#worksheet(spreadsheet_title, worksheet_title) ⇒ GoogleDrive::Worksheet|nil
Find a worksheet by title within a given spreadsheet.
19 20 21 22 |
# File 'lib/peoplegroup/connectors/google_sheets.rb', line 19 def worksheet(spreadsheet_title, worksheet_title) worksheets = retry_on_error { spreadsheet(spreadsheet_title).worksheets } worksheets.find { |worksheet| worksheet.title == worksheet_title } end |