Class: CSVPlusPlus::Options::GoogleSheetsOptions

Inherits:
Options
  • Object
show all
Extended by:
T::Sig
Defined in:
lib/csv_plus_plus/options/google_sheets_options.rb

Overview

The Google-specific options a user can supply.

Instance Attribute Summary collapse

Attributes inherited from Options

#backup, #create_if_not_exists, #key_values, #offset, #overwrite_values, #sheet_name, #verbose

Instance Method Summary collapse

Constructor Details

#initialize(sheet_name, sheet_id) ⇒ GoogleSheetsOptions

Returns a new instance of GoogleSheetsOptions.

Parameters:

  • sheet_name (String)

    The name of the sheet

  • sheet_id (String)

    The unique ID Google uses to reference the sheet



18
19
20
21
22
# File 'lib/csv_plus_plus/options/google_sheets_options.rb', line 18

def initialize(sheet_name, sheet_id)
  super(sheet_name)

  @sheet_id = sheet_id
end

Instance Attribute Details

#sheet_idString

The ID of the Google Sheet to write to.

Returns:

  • (String)

    the current value of sheet_id



9
10
11
# File 'lib/csv_plus_plus/options/google_sheets_options.rb', line 9

def sheet_id
  @sheet_id
end

Instance Method Details

#output_formatOutputFormat

Returns:



26
27
28
# File 'lib/csv_plus_plus/options/google_sheets_options.rb', line 26

def output_format
  ::CSVPlusPlus::Options::OutputFormat::GoogleSheets
end

#verbose_summaryString

Format a string with a verbose description of Google-specific options

Returns:

  • (String)


34
35
36
37
38
39
# File 'lib/csv_plus_plus/options/google_sheets_options.rb', line 34

def verbose_summary
  shared_summary(
    <<~SUMMARY)
      > Sheet ID | #{@sheet_id}
    SUMMARY
end