Class: Axlsx::Selection
- Inherits:
-
Object
- Object
- Axlsx::Selection
- Includes:
- OptionsParser, SerializedAttributes
- Defined in:
- lib/axlsx/workbook/worksheet/selection.rb
Overview
The recommended way to manage the selection pane options is via SheetView#add_selection
Selection options for worksheet panes.
Instance Attribute Summary collapse
-
#active_cell ⇒ String
Active Cell Location Location of the active cell.
-
#active_cell_id ⇒ Integer
Active Cell Index 0-based index of the range reference (in the array of references listed in sqref) containing the active cell.
-
#pane ⇒ Symbol
Pane The pane to which this selection belongs.
-
#sqref ⇒ String
Sequence of References Range of the selection.
Instance Method Summary collapse
-
#initialize(options = {}) ⇒ Selection
constructor
Creates a new Selection object.
-
#to_xml_string(str = '') ⇒ String
Serializes the data validation.
Methods included from SerializedAttributes
#declared_attributes, included, #serialized_attributes, #serialized_element_attributes, #serialized_tag
Methods included from OptionsParser
Constructor Details
#initialize(options = {}) ⇒ Selection
Creates a new Axlsx::Selection object
15 16 17 18 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 15 def initialize( = {}) @active_cell = @active_cell_id = @pane = @sqref = nil end |
Instance Attribute Details
#active_cell ⇒ String
Active Cell Location Location of the active cell. default nil
26 27 28 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 26 def active_cell @active_cell end |
#active_cell_id ⇒ Integer
Active Cell Index 0-based index of the range reference (in the array of references listed in sqref) containing the active cell. Only used when the selection in sqref is not contiguous. Therefore, this value needs to be aware of the order in which the range references are written in sqref. When this value is out of range then activeCell can be used. default nil
37 38 39 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 37 def active_cell_id @active_cell_id end |
#pane ⇒ Symbol
Pane The pane to which this selection belongs. Options are
- bottom_left: Bottom left pane, when both vertical and horizontal splits are applied. This value is also used when only a horizontal split has been applied, dividing the pane into upper and lower regions. In that case, this value specifies the bottom pane.
- bottom_right: Bottom right pane, when both vertical and horizontal splits are applied.
- top_left: Top left pane, when both vertical and horizontal splits are applied. This value is also used when only a horizontal split has been applied, dividing the pane into upper and lower regions. In that case, this value specifies the top pane. This value is also used when only a vertical split has been applied, dividing the pane into right and left regions. In that case, this value specifies the left pane
- top_right: Top right pane, when both vertical and horizontal splits are applied. This value is also used when only a vertical split has been applied, dividing the pane into right and left regions. In that case, this value specifies the right pane. default nil
64 65 66 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 64 def pane @pane end |
#sqref ⇒ String
Sequence of References Range of the selection. Can be non-contiguous set of ranges. default nil
71 72 73 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 71 def sqref @sqref end |
Instance Method Details
#to_xml_string(str = '') ⇒ String
Serializes the data validation
95 96 97 |
# File 'lib/axlsx/workbook/worksheet/selection.rb', line 95 def to_xml_string(str = '') serialized_tag 'selection', str end |