class OoxmlParser::FormTextProperties

Class for parsing ‘textFormPr` tag

Attributes

autofit[R]

@return [True, False] specifies if size of field should be autofit

comb[R]

@return [FormTextComb] parameters of text justification

format[R]

@return [FormTextFormat] text format

maximum_characters[R]

@return [ValuedChild] characters limit

multiline[R]

@return [True, False] specifies if field is multiline

Public Instance Methods

parse(node) click to toggle source

Parse FormTextProperties object @param node [Nokogiri::XML:Element] node to parse @return [FormTextProperties] result of parsing

# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_text_properties.rb, line 22
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'multiLine'
      @multiline = boolean_attribute_value(value)
    when 'autoFit'
      @autofit = boolean_attribute_value(value)
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'comb'
      @comb = FormTextComb.new(parent: self).parse(node_child)
    when 'maxCharacters'
      @maximum_characters = ValuedChild.new(:integer, parent: self).parse(node_child)
    when 'format'
      @format = FormTextFormat.new(parent: self).parse(node_child)
    end
  end
  self
end