Class: OoxmlParser::Selection
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Selection
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view/selection.rb
Overview
Class for ‘selection` data
Instance Attribute Summary collapse
-
#active_cell ⇒ Coordinates
readonly
Reference to the active cell.
-
#active_cell_id ⇒ Integer
readonly
Id of active cell.
-
#reference_sequence ⇒ String
readonly
Selected range.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ Selection
Parse Selection object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#active_cell ⇒ Coordinates (readonly)
Returns Reference to the active cell.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view/selection.rb', line 7 def active_cell @active_cell end |
#active_cell_id ⇒ Integer (readonly)
Returns Id of active cell.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view/selection.rb', line 9 def active_cell_id @active_cell_id end |
#reference_sequence ⇒ String (readonly)
Returns Selected range.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view/selection.rb', line 11 def reference_sequence @reference_sequence end |
Instance Method Details
#parse(node) ⇒ Selection
Parse Selection object
16 17 18 19 20 21 22 23 24 25 26 27 28 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view/selection.rb', line 16 def parse(node) node.attributes.each do |key, value| case key when 'activeCell' @active_cell = Coordinates.new.parse_string(value.value) when 'activeCellId' @active_cell_id = value.value.to_i when 'sqref' @reference_sequence = value.value.to_s end end self end |