Class: Readiness::GoogleSheets::Spreadsheets
- Defined in:
- lib/support_readiness/google_sheets/spreadsheets.rb
Overview
Defines the class Spreadsheets within the module Readiness::GoogleSheets.
Class Method Summary collapse
-
.append_data(client, range, values) ⇒ Object
Appends data to a spreadsheet.
-
.data(client, range) ⇒ Object
Gets data within a spreadsheet.
-
.get_info(client) ⇒ Object
Gets spreadsheet information.
-
.sheets(spreadsheet) ⇒ Object
Gets a list of spreadsheet sheets.
-
.update_data(client, range, values) ⇒ Object
Updates data in a spreadsheet.
Methods inherited from Client
auth_error, bad_request_error, convert_actions, convert_conditions, convert_standard_names_to_ids, convert_ticket_form_agent_conditions, convert_ticket_form_brands, convert_ticket_form_end_user_conditions, convert_ticket_form_names_to_ids, convert_view_names_to_ids, convert_view_restrictions, covert_ticket_form_field_ids, create_package!, erb_renderer, handle_request_error, not_found_error, not_processible_error, put_into_archive, recursively_deflate_directory, timestamp_filename, to_clean_json, to_clean_json_with_key, to_hash, to_nearly_clean_json, to_nearly_clean_json_with_key, to_param_string, write_entries
Class Method Details
.append_data(client, range, values) ⇒ Object
Appends data to a spreadsheet
92 93 94 95 |
# File 'lib/support_readiness/google_sheets/spreadsheets.rb', line 92 def self.append_data(client, range, values) value_range = Google::Apis::SheetsV4::ValueRange.new(values: values) client.service.append_spreadsheet_value(client.spreadsheet_id, range, value_range, value_input_option: 'RAW') end |
.data(client, range) ⇒ Object
Gets data within a spreadsheet
68 69 70 |
# File 'lib/support_readiness/google_sheets/spreadsheets.rb', line 68 def self.data(client, range) client.service.get_spreadsheet_values(client.spreadsheet_id, range) end |
.get_info(client) ⇒ Object
Gets spreadsheet information
29 30 31 |
# File 'lib/support_readiness/google_sheets/spreadsheets.rb', line 29 def self.get_info(client) client.service.get_spreadsheet(client.spreadsheet_id) end |
.sheets(spreadsheet) ⇒ Object
Gets a list of spreadsheet sheets
48 49 50 |
# File 'lib/support_readiness/google_sheets/spreadsheets.rb', line 48 def self.sheets(spreadsheet) spreadsheet.sheets.map { |s| s.properties.title } end |
.update_data(client, range, values) ⇒ Object
Updates data in a spreadsheet
117 118 119 120 |
# File 'lib/support_readiness/google_sheets/spreadsheets.rb', line 117 def self.update_data(client, range, values) value_range = Google::Apis::SheetsV4::ValueRange.new(values: values) client.service.update_spreadsheet_value(client.spreadsheet_id, range, value_range, value_input_option: 'RAW') end |