Class: OoxmlParser::WorkbookProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/xlsx_parser/workbook/workbook_properties.rb

Overview

Class for parsing <workbookPr> tag

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, #boolean_attribute_value, #parse_xml, #with_data?

Methods included from OoxmlObjectAttributeHelper

#attribute_enabled?, #option_enabled?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

#initialize(parent: nil) ⇒ WorkbookProperties

Returns a new instance of WorkbookProperties.



9
10
11
12
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_properties.rb', line 9

def initialize(parent: nil)
  @date1904 = false
  super
end

Instance Attribute Details

#date1904True, False (readonly)

Returns Specifies if 1904 date system is used in workbook.

Returns:

  • (True, False)

    Specifies if 1904 date system is used in workbook



7
8
9
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_properties.rb', line 7

def date1904
  @date1904
end

Instance Method Details

#parse(node) ⇒ WorkbookProperties

Parse WorkbookProperties data

Parameters:

  • node (Nokogiri::XML:Element)

    with WorkbookProperties data

Returns:



17
18
19
20
21
22
23
24
25
# File 'lib/ooxml_parser/xlsx_parser/workbook/workbook_properties.rb', line 17

def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'date1904'
      @date1904 = boolean_attribute_value(value)
    end
  end
  self
end