class Xlsxrb::Ooxml::WorksheetParser::ColumnsListener
Parses <cols> section for column definitions.
Attributes
columns
[R]
untyped
Public Class Methods
() → untyped
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 694 def initialize @columns = [] @in_cols = false end
Public Instance Methods
(untyped _text) → untyped
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 725 def characters(_text); end
(untyped _uri, untyped localname, untyped _qname) → untyped
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 721 def end_element(_uri, localname, _qname) @in_cols = false if localname == "cols" end
(untyped _uri, untyped localname, untyped _qname, untyped attrs) → untyped
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 699 def start_element(_uri, localname, _qname, attrs) case localname when "cols" @in_cols = true when "col" return unless @in_cols col = { min: attrs["min"]&.to_i, max: attrs["max"]&.to_i, width: attrs["width"]&.to_f, hidden: attrs["hidden"] == "1" || (attrs["hidden"]&.casecmp?("true") || false), custom_width: attrs["customWidth"] == "1" || (attrs["customWidth"]&.casecmp?("true") || false), best_fit: attrs["bestFit"] == "1" || (attrs["bestFit"]&.casecmp?("true") || false), collapsed: attrs["collapsed"] == "1" || (attrs["collapsed"]&.casecmp?("true") || false), outline_level: attrs["outlineLevel"]&.to_i, style_index: attrs["style"]&.to_i } @columns << col end end