Class: OoxmlParser::Chartsheet
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Chartsheet
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb
Overview
Class for storing data of chartsheets files
Instance Attribute Summary collapse
-
#sheet_views ⇒ Array, SheetView
Array of views.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ Chartsheet
constructor
A new instance of Chartsheet.
-
#parse(file) ⇒ Chartsheet
Parse Chartsheet 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) ⇒ Chartsheet
Returns a new instance of Chartsheet.
9 10 11 12 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb', line 9 def initialize(parent: nil) @sheet_views = [] super end |
Instance Attribute Details
#sheet_views ⇒ Array, SheetView
Returns array of views.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb', line 7 def sheet_views @sheet_views end |
Instance Method Details
#parse(file) ⇒ Chartsheet
Parse Chartsheet object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/chartsheet.rb', line 17 def parse(file) root_object.add_to_xmls_stack(root_object.root_subfolder + file) doc = parse_xml(root_object.current_xml) node = doc.xpath('//xmlns:chartsheet').first node.xpath('*').each do |node_child| case node_child.name when 'sheetViews' node_child.xpath('*').each do |view_child| @sheet_views << SheetView.new(parent: self).parse(view_child) end end end root_object.xmls_stack.pop self end |