Class: Xlsxrb::StreamWriter::WorksheetProxy
- Inherits:
-
Object
- Object
- Xlsxrb::StreamWriter::WorksheetProxy
- Defined in:
- lib/xlsxrb/stream_writer.rb,
sig/generated/xlsxrb/stream_writer.rbs
Overview
Proxy object yielded by the sheet method to prevent writing to inactive sheets in streaming mode.
Instance Method Summary collapse
-
#app_property ⇒ void
simplecov:disable Edge case / untested delegation block Sets app metadata property.
-
#auto_filter ⇒ void
Sets the auto-filter range on the active sheet.
-
#chart {|chart_builder| ... } ⇒ void
Adds a chart to the active sheet.
-
#cleanup! ⇒ void
simplecov:disable Edge case / untested delegation block : () -> void.
-
#column ⇒ void
Configures column width and properties.
-
#comment ⇒ void
Adds a comment to a cell.
-
#conditional_format ⇒ void
Adds conditional formatting to a range.
-
#core_property ⇒ void
simplecov:disable Edge case / untested delegation block Sets core metadata property.
-
#custom_property ⇒ void
simplecov:disable Edge case / untested delegation block Sets custom metadata property.
-
#defined_name ⇒ void
Adds a defined named range or formula.
-
#filter_column ⇒ void
Sets filter criteria for a column in the auto-filter.
-
#freeze_pane ⇒ void
Freezes rows and/or columns for scrolling.
-
#header_footer ⇒ void
Configures header and footer text for printing.
-
#hyperlink ⇒ void
Adds a hyperlink to a cell.
-
#image ⇒ void
Inserts an image into the sheet.
- #initialize(writer, sheet_name) ⇒ Object constructor
-
#internal_sheet_setup ⇒ void
simplecov:disable Edge case / untested delegation block : (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped.
-
#merge ⇒ void
Merges a range of cells into a single cell.
-
#page_break_col ⇒ void
simplecov:disable Edge case / untested delegation block Adds a vertical page break after the given column index.
-
#page_break_row ⇒ void
simplecov:disable Edge case / untested delegation block Adds a horizontal page break after the given row index.
-
#page_margins ⇒ void
Configures page margins for printing.
-
#page_setup ⇒ void
Configures page orientation, paper size, and print setup.
-
#pivot_table ⇒ void
Adds a Pivot Table to the sheet.
-
#print_area ⇒ void
simplecov:disable Edge case / untested delegation block Sets the print area range for the sheet.
-
#print_options ⇒ void
Configures print options (e.g. gridlines, headings).
-
#print_titles ⇒ void
simplecov:disable Edge case / untested delegation block Configures repeating title rows and columns for printing.
-
#properties ⇒ void
simplecov:disable Edge case / untested delegation block Sets document metadata properties (core, app, custom).
-
#protect_sheet ⇒ void
Protects the worksheet against modifications.
-
#protect_workbook ⇒ void
simplecov:disable Edge case / untested delegation block Protects the workbook structure.
-
#row(values, styles: nil, height: nil, hidden: false, custom_height: false, outline_level: nil) ⇒ void
(also: #<<)
Appends a row of cells to the active sheet.
-
#select_cell ⇒ void
Sets the active/selected cell on the sheet.
-
#shape ⇒ void
Adds a drawing shape to the sheet.
-
#sheet_properties ⇒ void
Sets sheet properties (e.g. tab color, page setup flags).
-
#sheet_view ⇒ void
Configures sheet view settings (zoom scale, grid lines visibility).
-
#sort_state ⇒ void
Configures sort state on a range.
-
#sparkline_group ⇒ void
Adds sparklines to the sheet.
-
#split_pane ⇒ void
Splits sheet view into panes.
-
#style {|style_builder| ... } ⇒ Xlsxrb::StyleBuilder
Defines or configures a named cell style on the active sheet.
-
#table ⇒ void
Adds a formatted Excel Table to the sheet.
-
#validate_data ⇒ void
Adds data validation rules to a range.
-
#workbook_property ⇒ void
Sets workbook-level properties.
Constructor Details
#initialize(writer, sheet_name) ⇒ Object
131 132 133 134 |
# File 'lib/xlsxrb/stream_writer.rb', line 131 def initialize(writer, sheet_name) @writer = writer @sheet_name = sheet_name end |
Instance Method Details
#app_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Sets app metadata property.
: (String | Symbol name, untyped value) -> void
701 702 703 704 705 |
# File 'lib/xlsxrb/stream_writer.rb', line 701 def app_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.app_property(...) end |
#auto_filter ⇒ void
This method returns an undefined value.
Sets the auto-filter range on the active sheet.
: (String ref) -> void
305 306 307 308 309 |
# File 'lib/xlsxrb/stream_writer.rb', line 305 def auto_filter(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.auto_filter(...) end |
#chart {|chart_builder| ... } ⇒ void
This method returns an undefined value.
Adds a chart to the active sheet.
: (?Symbol | String? type, **untyped opts) ?{ (Xlsxrb::ChartBuilder) -> void } -> void
268 269 270 271 272 |
# File 'lib/xlsxrb/stream_writer.rb', line 268 def chart(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.chart(...) end |
#cleanup! ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block : () -> void
401 402 403 404 405 |
# File 'lib/xlsxrb/stream_writer.rb', line 401 def cleanup!(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.cleanup!(...) end |
#column ⇒ void
This method returns an undefined value.
Configures column width and properties.
: (Integer | String | Symbol | Range[Integer | String] | Array[Integer | String] col_index, ?width: Float | Integer | nil, ?hidden: bool, ?best_fit: bool, ?custom_width: bool, ?outline_level: Integer | nil, ?collapsed: bool) -> void
247 248 249 250 251 |
# File 'lib/xlsxrb/stream_writer.rb', line 247 def column(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.column(...) end |
#comment ⇒ void
This method returns an undefined value.
Adds a comment to a cell.
: (String | Integer cell, String text, ?author: String) -> void
419 420 421 422 423 |
# File 'lib/xlsxrb/stream_writer.rb', line 419 def comment(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.comment(...) end |
#conditional_format ⇒ void
This method returns an undefined value.
Adds conditional formatting to a range.
: (String range, ?type: String | Symbol, **untyped opts) -> void
372 373 374 375 376 |
# File 'lib/xlsxrb/stream_writer.rb', line 372 def conditional_format(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.conditional_format(...) end |
#core_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Sets core metadata property.
: (String | Symbol name, untyped value) -> void
598 599 600 601 602 |
# File 'lib/xlsxrb/stream_writer.rb', line 598 def core_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.core_property(...) end |
#custom_property ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Sets custom metadata property.
: (String | Symbol name, untyped value) -> void
729 730 731 732 733 |
# File 'lib/xlsxrb/stream_writer.rb', line 729 def custom_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.custom_property(...) end |
#defined_name ⇒ void
This method returns an undefined value.
Adds a defined named range or formula.
: (String name, String formula, ?sheet_id: Integer | nil, ?hidden: bool) -> void
502 503 504 505 506 |
# File 'lib/xlsxrb/stream_writer.rb', line 502 def defined_name(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.defined_name(...) end |
#filter_column ⇒ void
This method returns an undefined value.
Sets filter criteria for a column in the auto-filter.
: (Integer col_id, Array | Hash[Symbol, untyped] filter_values) -> void
321 322 323 324 325 |
# File 'lib/xlsxrb/stream_writer.rb', line 321 def filter_column(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.filter_column(...) end |
#freeze_pane ⇒ void
This method returns an undefined value.
Freezes rows and/or columns for scrolling.
: (?row: Integer | nil, ?col: Integer | nil) -> void
521 522 523 524 525 |
# File 'lib/xlsxrb/stream_writer.rb', line 521 def freeze_pane(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.freeze_pane(...) end |
#header_footer ⇒ void
This method returns an undefined value.
Configures header and footer text for printing.
: (**untyped opts) -> void
656 657 658 659 660 |
# File 'lib/xlsxrb/stream_writer.rb', line 656 def (...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.(...) end |
#hyperlink ⇒ void
This method returns an undefined value.
Adds a hyperlink to a cell.
: (String cell, ?String? url, ?display: String?, ?tooltip: String?, ?location: String?) -> void
290 291 292 293 294 |
# File 'lib/xlsxrb/stream_writer.rb', line 290 def hyperlink(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.hyperlink(...) end |
#image ⇒ void
This method returns an undefined value.
Inserts an image into the sheet.
: (String file_data, ?ext: String, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
748 749 750 751 752 |
# File 'lib/xlsxrb/stream_writer.rb', line 748 def image(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.image(...) end |
#internal_sheet_setup ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block : (*untyped args, **untyped kwargs) ?{ (*untyped) -> untyped } -> untyped
201 202 203 204 205 |
# File 'lib/xlsxrb/stream_writer.rb', line 201 def internal_sheet_setup(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.internal_sheet_setup(...) end |
#merge ⇒ void
This method returns an undefined value.
Merges a range of cells into a single cell.
: (?String? range, ?row: Integer | nil, ?col_start: (Integer | String)?, ?col_end: (Integer | String)?, ?row_start: Integer | nil, ?row_end: Integer | nil) -> void
171 172 173 174 175 |
# File 'lib/xlsxrb/stream_writer.rb', line 171 def merge(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.merge(...) end |
#page_break_col ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Adds a vertical page break after the given column index.
: (Integer col_index) -> void
790 791 792 793 794 |
# File 'lib/xlsxrb/stream_writer.rb', line 790 def page_break_col(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_break_col(...) end |
#page_break_row ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Adds a horizontal page break after the given row index.
: (Integer row_index) -> void
775 776 777 778 779 |
# File 'lib/xlsxrb/stream_writer.rb', line 775 def page_break_row(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_break_row(...) end |
#page_margins ⇒ void
This method returns an undefined value.
Configures page margins for printing.
: (?left: Float | nil, ?right: Float | nil, ?top: Float | nil, ?bottom: Float | nil, ?header: Float | nil, ?footer: Float | nil) -> void
630 631 632 633 634 |
# File 'lib/xlsxrb/stream_writer.rb', line 630 def page_margins(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_margins(...) end |
#page_setup ⇒ void
This method returns an undefined value.
Configures page orientation, paper size, and print setup.
: (?orientation: (String | Symbol)?, ?paper_size: Integer | nil, **untyped opts) -> void
644 645 646 647 648 |
# File 'lib/xlsxrb/stream_writer.rb', line 644 def page_setup(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.page_setup(...) end |
#pivot_table ⇒ void
This method returns an undefined value.
Adds a Pivot Table to the sheet.
: (String source_ref, row_fields: untyped, data_fields: untyped, ?col_fields: untyped, ?dest_ref: String, ?name: String?, ?field_names: untyped, ?items: untyped, **untyped opts) -> void
439 440 441 442 443 |
# File 'lib/xlsxrb/stream_writer.rb', line 439 def pivot_table(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.pivot_table(...) end |
#print_area ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Sets the print area range for the sheet.
: (String ref) -> void
535 536 537 538 539 |
# File 'lib/xlsxrb/stream_writer.rb', line 535 def print_area(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_area(...) end |
#print_options ⇒ void
This method returns an undefined value.
Configures print options (e.g. gridlines, headings).
: (Symbol | String name, untyped value) -> void
669 670 671 672 673 |
# File 'lib/xlsxrb/stream_writer.rb', line 669 def (...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.(...) end |
#print_titles ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Configures repeating title rows and columns for printing.
: (?rows: String?, ?cols: String?) -> void
551 552 553 554 555 |
# File 'lib/xlsxrb/stream_writer.rb', line 551 def print_titles(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.print_titles(...) end |
#properties ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Sets document metadata properties (core, app, custom).
: (?core: Hash[untyped, untyped]?, ?app: Hash[untyped, untyped]?, ?custom: Hash[untyped, untyped]?) -> void
685 686 687 688 689 |
# File 'lib/xlsxrb/stream_writer.rb', line 685 def properties(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.properties(...) end |
#protect_sheet ⇒ void
This method returns an undefined value.
Protects the worksheet against modifications.
: (**untyped opts) -> void
714 715 716 717 718 |
# File 'lib/xlsxrb/stream_writer.rb', line 714 def protect_sheet(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_sheet(...) end |
#protect_workbook ⇒ void
This method returns an undefined value.
simplecov:disable Edge case / untested delegation block Protects the workbook structure.
: (**untyped opts) -> void
582 583 584 585 586 |
# File 'lib/xlsxrb/stream_writer.rb', line 582 def protect_workbook(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.protect_workbook(...) end |
#row(values, styles: nil, height: nil, hidden: false, custom_height: false, outline_level: nil) ⇒ void Also known as: <<
This method returns an undefined value.
Appends a row of cells to the active sheet.
: (Array | Hash[untyped, untyped] values, ?styles: untyped, ?height: Float | Integer | nil, ?hidden: bool, ?custom_height: bool, ?outline_level: Integer | nil) -> void
225 226 227 228 229 |
# File 'lib/xlsxrb/stream_writer.rb', line 225 def row(values, styles: nil, height: nil, hidden: false, custom_height: false, outline_level: nil) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.row(values, styles: styles, height: height, hidden: hidden, custom_height: custom_height, outline_level: outline_level) end |
#select_cell ⇒ void
This method returns an undefined value.
Sets the active/selected cell on the sheet.
: (String active_cell, ?sqref: String?, ?pane: (String | Symbol)?) -> void
613 614 615 616 617 |
# File 'lib/xlsxrb/stream_writer.rb', line 613 def select_cell(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.select_cell(...) end |
#shape ⇒ void
This method returns an undefined value.
Adds a drawing shape to the sheet.
: (?preset: String, ?text: String?, ?from_col: Integer, ?from_row: Integer, ?to_col: Integer, ?to_row: Integer, **untyped opts) -> void
192 193 194 195 196 |
# File 'lib/xlsxrb/stream_writer.rb', line 192 def shape(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.shape(...) end |
#sheet_properties ⇒ void
This method returns an undefined value.
Sets sheet properties (e.g. tab color, page setup flags).
: (Symbol | String name, untyped value) -> void
484 485 486 487 488 |
# File 'lib/xlsxrb/stream_writer.rb', line 484 def sheet_properties(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_properties(...) end |
#sheet_view ⇒ void
This method returns an undefined value.
Configures sheet view settings (zoom scale, grid lines visibility).
: (Symbol | String name, untyped value) -> void
761 762 763 764 765 |
# File 'lib/xlsxrb/stream_writer.rb', line 761 def sheet_view(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sheet_view(...) end |
#sort_state ⇒ void
This method returns an undefined value.
Configures sort state on a range.
: (String ref, Array[Hash[Symbol, untyped]] | Hash[Symbol, untyped] sort_conditions, **untyped opts) -> void
338 339 340 341 342 |
# File 'lib/xlsxrb/stream_writer.rb', line 338 def sort_state(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sort_state(...) end |
#sparkline_group ⇒ void
This method returns an undefined value.
Adds sparklines to the sheet.
: (sparklines: Array[Hash[Symbol, untyped]], ?type: (String | Symbol)?, **untyped opts) -> void
456 457 458 459 460 |
# File 'lib/xlsxrb/stream_writer.rb', line 456 def sparkline_group(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.sparkline_group(...) end |
#split_pane ⇒ void
This method returns an undefined value.
Splits sheet view into panes.
: (?x_split: Numeric | nil, ?y_split: Numeric | nil, ?top_left_cell: String?, ?active_pane: String?, ?state: String?) -> void
568 569 570 571 572 |
# File 'lib/xlsxrb/stream_writer.rb', line 568 def split_pane(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.split_pane(...) end |
#style {|style_builder| ... } ⇒ Xlsxrb::StyleBuilder
Defines or configures a named cell style on the active sheet.
: (String | Symbol name, **untyped opts) ?{ (Xlsxrb::StyleBuilder) -> void } -> Xlsxrb::StyleBuilder
148 149 150 151 152 |
# File 'lib/xlsxrb/stream_writer.rb', line 148 def style(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.style(...) end |
#table ⇒ void
This method returns an undefined value.
Adds a formatted Excel Table to the sheet.
: (String ref, columns: untyped, ?name: String?, ?display_name: String?, ?style: String?, **untyped opts) -> void
392 393 394 395 396 |
# File 'lib/xlsxrb/stream_writer.rb', line 392 def table(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.table(...) end |
#validate_data ⇒ void
This method returns an undefined value.
Adds data validation rules to a range.
: (String range, ?type: String | Symbol, **untyped opts) -> void
355 356 357 358 359 |
# File 'lib/xlsxrb/stream_writer.rb', line 355 def validate_data(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.validate_data(...) end |
#workbook_property ⇒ void
This method returns an undefined value.
Sets workbook-level properties.
: (**untyped opts) -> void
468 469 470 471 472 |
# File 'lib/xlsxrb/stream_writer.rb', line 468 def workbook_property(...) raise Error, "Sheet '#{@sheet_name}' is no longer active. In streaming mode, you cannot write to a previous sheet." if @writer.current_sheet != @sheet_name @writer.workbook_property(...) end |