Class: OoxmlParser::Sheet
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::Sheet
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/sheet.rb
Overview
Class for parsing <sheet> tag
Instance Attribute Summary collapse
-
#id ⇒ String
readonly
Id of sheet.
-
#name ⇒ String
readonly
Name of sheet.
-
#sheet_id ⇒ Integer
readonly
SheetId of sheet.
-
#state ⇒ Symbol
readonly
Specifies if sheet is hidden.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#initialize(parent: nil) ⇒ Sheet
constructor
A new instance of Sheet.
-
#parse(node) ⇒ Sheet
Parse Sheet data.
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) ⇒ Sheet
Returns a new instance of Sheet.
15 16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 15 def initialize(parent: nil) @state = :visible super end |
Instance Attribute Details
#id ⇒ String (readonly)
Returns Id of sheet.
13 14 15 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 13 def id @id end |
#name ⇒ String (readonly)
Returns Name of sheet.
7 8 9 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 7 def name @name end |
#sheet_id ⇒ Integer (readonly)
Returns SheetId of sheet.
9 10 11 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 9 def sheet_id @sheet_id end |
#state ⇒ Symbol (readonly)
Returns Specifies if sheet is hidden.
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 11 def state @state end |
Instance Method Details
#parse(node) ⇒ Sheet
Parse Sheet data
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/sheet.rb', line 23 def parse(node) node.attributes.each do |key, value| case key when 'name' @name = value.value.to_s when 'sheetId' @sheet_id = value.value.to_i when 'state' @state = value.value.to_sym when 'id' @id = value.value.to_s end end self end |