class OoxmlParser::ParagraphRun
Class for parsing ‘r` tags
Attributes
@return [Text] text of run
@return [Tab] tab of paragraph
Public Class Methods
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 14 def initialize(properties = RunProperties.new, text = '', parent: nil) @properties = properties @text = text super(parent: parent) end
Calls superclass method
OoxmlParser::OOXMLDocumentObject::new
Public Instance Methods
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 39 def empty? text.empty? end
@return [True, False] is current run empty
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 44 def instruction parent.instruction end
@return [String] instruction applied to paragraph
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 54 def link parent.parent.hyperlink end
@return [Hyperlink] link of run
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 49 def page_number parent.page_numbering? end
@return [True, False] is page number applyed
Source
# File lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb, line 23 def parse(node) node.xpath('*').each do |node_child| case node_child.name when 'rPr' @properties = RunProperties.new(parent: self).parse(node_child) when 't' @t = Text.new(parent: self).parse(node_child) @text = t.text when 'tab' @tab = Tab.new(parent: self).parse(node_child) end end self end
Parse ParagraphRun
object @param node [Nokogiri::XML:Element] node to parse @return [ParagraphRun] result of parsing