Class: Google::Apis::SheetsV4::FindReplaceRequest
- Inherits:
-
Object
- Object
- Google::Apis::SheetsV4::FindReplaceRequest
- Includes:
- Core::Hashable, Core::JsonObjectSupport
- Defined in:
- lib/google/apis/sheets_v4/classes.rb,
lib/google/apis/sheets_v4/representations.rb,
lib/google/apis/sheets_v4/representations.rb
Overview
Finds and replaces data in cells over a range, sheet, or all sheets.
Instance Attribute Summary collapse
-
#all_sheets ⇒ Boolean
(also: #all_sheets?)
True to find/replace over all sheets.
-
#find ⇒ String
The value to search.
-
#include_formulas ⇒ Boolean
(also: #include_formulas?)
True if the search should include cells with formulas.
-
#match_case ⇒ Boolean
(also: #match_case?)
True if the search is case sensitive.
-
#match_entire_cell ⇒ Boolean
(also: #match_entire_cell?)
True if the find value should match the entire cell.
-
#range ⇒ Google::Apis::SheetsV4::GridRange
A range on a sheet.
-
#replacement ⇒ String
The value to use as the replacement.
-
#search_by_regex ⇒ Boolean
(also: #search_by_regex?)
True if the find value is a regex.
-
#sheet_id ⇒ Fixnum
The sheet to find/replace over.
Instance Method Summary collapse
-
#initialize(**args) ⇒ FindReplaceRequest
constructor
A new instance of FindReplaceRequest.
-
#update!(**args) ⇒ Object
Update properties of this object.
Constructor Details
#initialize(**args) ⇒ FindReplaceRequest
Returns a new instance of FindReplaceRequest.
5976 5977 5978 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5976 def initialize(**args) update!(**args) end |
Instance Attribute Details
#all_sheets ⇒ Boolean Also known as: all_sheets?
True to find/replace over all sheets.
Corresponds to the JSON property allSheets
5910 5911 5912 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5910 def all_sheets @all_sheets end |
#find ⇒ String
The value to search.
Corresponds to the JSON property find
5916 5917 5918 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5916 def find @find end |
#include_formulas ⇒ Boolean Also known as: include_formulas?
True if the search should include cells with formulas. False to skip cells
with formulas.
Corresponds to the JSON property includeFormulas
5922 5923 5924 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5922 def include_formulas @include_formulas end |
#match_case ⇒ Boolean Also known as: match_case?
True if the search is case sensitive.
Corresponds to the JSON property matchCase
5928 5929 5930 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5928 def match_case @match_case end |
#match_entire_cell ⇒ Boolean Also known as: match_entire_cell?
True if the find value should match the entire cell.
Corresponds to the JSON property matchEntireCell
5934 5935 5936 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5934 def match_entire_cell @match_entire_cell end |
#range ⇒ Google::Apis::SheetsV4::GridRange
A range on a sheet. All indexes are zero-based. Indexes are half open, i.e.
the start index is inclusive and the end index is exclusive -- [start_index,
end_index). Missing indexes indicate the range is unbounded on that side. For
example, if "Sheet1" is sheet ID 123456, then: Sheet1!A1:A1 == sheet_id:
123456, start_row_index: 0, end_row_index: 1, start_column_index: 0,
end_column_index: 1 Sheet1!A3:B4 == sheet_id: 123456, start_row_index: 2,
end_row_index: 4, start_column_index: 0, end_column_index: 2 Sheet1!A:B ==
sheet_id: 123456, start_column_index: 0, end_column_index: 2 Sheet1!A5:B ==
sheet_id: 123456, start_row_index: 4, start_column_index: 0, end_column_index:
2 Sheet1 == sheet_id: 123456 The start index must always be less than or
equal to the end index. If the start index equals the end index, then the
range is empty. Empty ranges are typically not meaningful and are usually
rendered in the UI as #REF!.
Corresponds to the JSON property range
5952 5953 5954 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5952 def range @range end |
#replacement ⇒ String
The value to use as the replacement.
Corresponds to the JSON property replacement
5957 5958 5959 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5957 def replacement @replacement end |
#search_by_regex ⇒ Boolean Also known as: search_by_regex?
True if the find value is a regex. The regular expression and replacement
should follow Java regex rules at https://docs.oracle.com/javase/8/docs/api/
java/util/regex/Pattern.html. The replacement string is allowed to refer to
capturing groups. For example, if one cell has the contents "Google Sheets"
and another has "Google Docs", then searching for "o.* (.*)" with a
replacement of "$1 Rocks" would change the contents of the cells to "
GSheets Rocks" and "GDocs Rocks" respectively.
Corresponds to the JSON property searchByRegex
5968 5969 5970 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5968 def search_by_regex @search_by_regex end |
#sheet_id ⇒ Fixnum
The sheet to find/replace over.
Corresponds to the JSON property sheetId
5974 5975 5976 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5974 def sheet_id @sheet_id end |
Instance Method Details
#update!(**args) ⇒ Object
Update properties of this object
5981 5982 5983 5984 5985 5986 5987 5988 5989 5990 5991 |
# File 'lib/google/apis/sheets_v4/classes.rb', line 5981 def update!(**args) @all_sheets = args[:all_sheets] if args.key?(:all_sheets) @find = args[:find] if args.key?(:find) @include_formulas = args[:include_formulas] if args.key?(:include_formulas) @match_case = args[:match_case] if args.key?(:match_case) @match_entire_cell = args[:match_entire_cell] if args.key?(:match_entire_cell) @range = args[:range] if args.key?(:range) @replacement = args[:replacement] if args.key?(:replacement) @search_by_regex = args[:search_by_regex] if args.key?(:search_by_regex) @sheet_id = args[:sheet_id] if args.key?(:sheet_id) end |