class OoxmlParser::FieldSimple
Class for parsing ‘w:fldSimple` tags
Attributes
@return [String] instruction value
@return [Array<ParagraphRun>] instruction value
Public Class Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/field_simple.rb, line 11 def initialize(parent: nil) @runs = [] super end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/field_simple.rb, line 37 def page_numbering? instruction.include?('PAGE') end
@return [True, False] is field simple page numbering
Source
# File lib/ooxml_parser/docx_parser/document_structure/docx_paragraph/field_simple.rb, line 19 def parse(node) node.attributes.each do |key, value| case key when 'instr' @instruction = value.value.to_s end end node.xpath('*').each do |node_child| case node_child.name when 'r' @runs << ParagraphRun.new(parent: self).parse(node_child) end end self end
Parse FieldSimple
object @param node [Nokogiri::XML:Element] node to parse @return [FieldSimple] result of parsing