Sha256: d426466b9d61dfdf874edb32946f516c6431583c3ffcfb78f191ad26e8dff18d
Contents?: true
Size: 975 Bytes
Versions: 4
Compression:
Stored size: 975 Bytes
Contents
module OoxmlParser # Character Alignment in XLSX class XlsxAlignment < OOXMLDocumentObject attr_accessor :horizontal, :vertical, :wrap_text, :text_rotation def initialize(horizontal = :left, vertical = :bottom, wrap_text = false, parent: nil) @horizontal = horizontal @vertical = vertical @wrap_text = wrap_text @parent = parent end # Parse XlsxAlignment object # @param node [Nokogiri::XML:Element] node to parse # @return [XlsxAlignment] result of parsing def parse(node) node.attributes.each do |key, value| case key when 'horizontal' @horizontal = value.value.to_sym @wrap_text = true if @horizontal == :justify when 'vertical' @vertical = value.value.to_sym when 'wrapText' @wrap_text = value.value.to_s == '1' when 'textRotation' @text_rotation = value.value.to_i end end self end end end
Version data entries
4 entries across 4 versions & 1 rubygems