Class: OoxmlParser::SheetView
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::SheetView
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb
Overview
Class for ‘sheetView` data
Instance Attribute Summary collapse
-
#pane ⇒ Object
Returns the value of attribute pane.
-
#selection ⇒ Selection
readonly
Properties of selection.
-
#show_gridlines ⇒ True, False
Flag indicating whether this sheet should display gridlines.
-
#show_row_column_headers ⇒ True, False
Flag indicating whether the sheet should display row and column headings.
-
#top_left_cell ⇒ Coordinates
readonly
Reference to the top left cell.
-
#workbook_view_id ⇒ Integer
readonly
Id of workbook view.
-
#zoom_scale ⇒ Integer
readonly
Zoom scale.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ SheetView
constructor
A new instance of SheetView.
-
#parse(node) ⇒ SheetView
Parse SheetView object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ SheetView
Returns a new instance of SheetView.
22 23 24 25 26 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 22 def initialize(parent: nil) @show_gridlines = true @show_row_column_headers = true super end |
Instance Attribute Details
#pane ⇒ Object
Returns the value of attribute pane.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 8 def pane @pane end |
#selection ⇒ Selection (readonly)
Returns Properties of selection.
20 21 22 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 20 def selection @selection end |
#show_gridlines ⇒ True, False
Returns Flag indicating whether this sheet should display gridlines.
10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 10 def show_gridlines @show_gridlines end |
#show_row_column_headers ⇒ True, False
Returns Flag indicating whether the sheet should display row and column headings.
12 13 14 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 12 def show_row_column_headers @show_row_column_headers end |
#top_left_cell ⇒ Coordinates (readonly)
Returns Reference to the top left cell.
14 15 16 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 14 def top_left_cell @top_left_cell end |
#workbook_view_id ⇒ Integer (readonly)
Returns Id of workbook view.
16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 16 def workbook_view_id @workbook_view_id end |
#zoom_scale ⇒ Integer (readonly)
Returns Zoom scale.
18 19 20 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 18 def zoom_scale @zoom_scale end |
Instance Method Details
#parse(node) ⇒ SheetView
Parse SheetView object
31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/sheet_view.rb', line 31 def parse(node) node.attributes.each do |key, value| case key when 'showGridLines' @show_gridlines = boolean_attribute_value(value) when 'showRowColHeaders' @show_row_column_headers = boolean_attribute_value(value) when 'topLeftCell' @top_left_cell = Coordinates.new.parse_string(value.value) when 'workbookViewId' @workbook_view_id = value.value.to_i when 'zoomScale' @zoom_scale = value.value.to_i end end node.xpath('*').each do |node_child| case node_child.name when 'pane' @pane = Pane.new(parent: self).parse(node_child) when 'selection' @selection = Selection.new(parent: self).parse(node_child) end end self end |