Class: OoxmlParser::XlsxColumnProperties
- Inherits:
-
OOXMLDocumentObject
- Object
- OOXMLDocumentObject
- OoxmlParser::XlsxColumnProperties
- Extended by:
- Gem::Deprecate
- Defined in:
- lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb
Overview
Properties of XLSX column
Instance Attribute Summary collapse
-
#best_fit ⇒ True, False
specified column(s) is set to ‘best fit’.
-
#custom_width ⇒ True, False
Is width custom.
-
#hidden ⇒ True, False
readonly
specified column(s) is hidden.
-
#max ⇒ Integer
(also: #to)
readonly
Last column affected by this ‘column info’ record.
-
#min ⇒ Integer
(also: #from)
readonly
First column affected by this ‘column info’ record.
-
#style ⇒ Object
Returns the value of attribute style.
-
#width ⇒ Float
readonly
Width, in readable format.
-
#width_raw ⇒ Float
readonly
Width in pixel, as stored in xml structure.
Attributes inherited from OOXMLDocumentObject
Instance Method Summary collapse
-
#parse(node) ⇒ XlsxColumnProperties
Parse XlsxColumnProperties object.
Methods inherited from OOXMLDocumentObject
#==, #boolean_attribute_value, #initialize, #parse_xml, #with_data?
Methods included from OoxmlObjectAttributeHelper
#attribute_enabled?, #option_enabled?
Methods included from OoxmlDocumentObjectHelper
Constructor Details
This class inherits a constructor from OoxmlParser::OOXMLDocumentObject
Instance Attribute Details
#best_fit ⇒ True, False
specified column(s) is set to ‘best fit’
11 12 13 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 11 def best_fit @best_fit end |
#custom_width ⇒ True, False
Returns is width custom.
8 9 10 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 8 def custom_width @custom_width end |
#hidden ⇒ True, False (readonly)
specified column(s) is hidden
14 15 16 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 14 def hidden @hidden end |
#max ⇒ Integer (readonly) Also known as: to
Returns Last column affected by this ‘column info’ record.
18 19 20 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 18 def max @max end |
#min ⇒ Integer (readonly) Also known as: from
Returns First column affected by this ‘column info’ record.
16 17 18 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 16 def min @min end |
#style ⇒ Object
Returns the value of attribute style.
6 7 8 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 6 def style @style end |
#width ⇒ Float (readonly)
Returns width, in readable format.
22 23 24 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 22 def width @width end |
#width_raw ⇒ Float (readonly)
Returns width in pixel, as stored in xml structure.
20 21 22 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 20 def width_raw @width_raw end |
Instance Method Details
#parse(node) ⇒ XlsxColumnProperties
Parse XlsxColumnProperties object
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/ooxml_parser/xlsx_parser/workbook/worksheet/xlsx_columns/xlsx_column_properties.rb', line 27 def parse(node) node.attributes.each do |key, value| case key when 'min' @min = value.value.to_i when 'max' @max = value.value.to_i when 'style' @style = root_object.style_sheet.cell_xfs.xf_array[value.value.to_i] when 'width' @width_raw = value.value.to_f @width = calculate_width(@width_raw) when 'customWidth' @custom_width = option_enabled?(node, 'customWidth') when 'bestFit' @best_fit = boolean_attribute_value(value) when 'hidden' @hidden = boolean_attribute_value(value) end end self end |