class Xlsxrb::Ooxml::WorksheetParser::ColumnsListener
Parses <cols> section for column definitions.
Attributes
Public Class Methods
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 423 def initialize @columns = [] @in_cols = false end
Public Instance Methods
Source
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 451 def characters(_text); end
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 447 def end_element(_uri, localname, _qname) @in_cols = false if localname == "cols" end
# File lib/xlsxrb/ooxml/worksheet_parser.rb, line 428 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", custom_width: attrs["customWidth"] == "1", outline_level: attrs["outlineLevel"]&.to_i } @columns << col end end