Class: OoxmlParser::SheetFormatProperties

Inherits:
Object
  • Object
show all
Defined in:
lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(column_width = nil, row_height = nil) ⇒ SheetFormatProperties

Returns a new instance of SheetFormatProperties.



6
7
8
9
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb', line 6

def initialize(column_width = nil, row_height = nil)
  @default_column_width = column_width
  @default_row_height = row_height
end

Instance Attribute Details

#default_column_widthObject

Returns the value of attribute default_column_width.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb', line 4

def default_column_width
  @default_column_width
end

#default_row_heightObject

Returns the value of attribute default_row_height.



4
5
6
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb', line 4

def default_row_height
  @default_row_height
end

Class Method Details

.parse(node) ⇒ SheetFormatProperties

Parse SheetFormatProperties

Parameters:

  • node (Nokogiri::XML::Element)

    node to parse

Returns:



14
15
16
17
18
19
# File 'lib/ooxml_parser/xlsx_parser/xlsx_data/view_model/workbook/worksheet/sheet_format_properties.rb', line 14

def self.parse(node)
  format_properties = SheetFormatProperties.new
  format_properties.default_column_width = node.attribute('defaultColWidth').value.to_f
  format_properties.default_row_height = node.attribute('defaultRowHeight').value.to_f
  format_properties
end