class OoxmlParser::FormProperties
Class for parsing ‘formPr` tag
Attributes
@return [BordersProperties] border of field
@return [String] text of tooltip
@return [String] field key
@return [True, False] specifies if field is required
@return [Shade] shade of field
Public Class Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_properties.rb, line 17 def initialize(parent: nil) @required = false super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/sdt/sdt_properties/form_properties.rb, line 25 def parse(node) node.attributes.each do |key, value| case key when 'key' @key = value.value when 'helpText' @help_text = value.value when 'required' @required = boolean_attribute_value(value) end end node.xpath('*').each do |node_child| case node_child.name when 'shd' @shade = Shade.new(parent: self).parse(node_child) when 'border' @border = BordersProperties.new(parent: self).parse(node_child) end end self end
Parse FormProperties
object @param node [Nokogiri::XML:Element] node to parse @return [FormProperties] result of parsing