Class: OoxmlParser::SheetView
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::SheetView
- Defined in:
- lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb
Overview
Class for sheetView data
Instance Attribute Summary collapse
-
#pane ⇒ Object
Returns the value of attribute pane.
-
#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.
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
#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, unzip_file, #with_data?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
#initialize(parent: nil) ⇒ SheetView
Returns a new instance of SheetView.
11 12 13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb', line 11 def initialize(parent: nil) @parent = parent @show_gridlines = true @show_row_column_headers = true end |
Instance Attribute Details
#pane ⇒ Object
Returns the value of attribute pane.
5 6 7 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb', line 5 def pane @pane end |
#show_gridlines ⇒ True, False
Returns Flag indicating whether this sheet should display gridlines.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb', line 7 def show_gridlines @show_gridlines end |
#show_row_column_headers ⇒ True, False
Returns Flag indicating whether the sheet should display row and column headings.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb', line 9 def show_row_column_headers @show_row_column_headers end |
Instance Method Details
#parse(node) ⇒ SheetView
Parse SheetView object
20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_view.rb', line 20 def parse(node) node.attributes.each_key do |key| case key when 'showGridLines' @show_gridlines = attribute_enabled?(node, key) when 'showRowColHeaders' @show_row_column_headers = attribute_enabled?(node, key) end end node.xpath('*').each do |node_child| case node_child.name when 'pane' @pane = Pane.new(parent: self).parse(node_child) end end self end |