Sha256: ca298dfc0d4a8adadfb241b15b60672572c2ce1c5657664f66f5c6ed08f41f68

Contents?: true

Size: 661 Bytes

Versions: 2

Compression:

Stored size: 661 Bytes

Contents

require_relative 'paragraph_run/run_properties'
module OoxmlParser
  class ParagraphRun < OOXMLDocumentObject
    attr_accessor :properties, :text

    def initialize(properties = RunProperties.new, text = '')
      @properties = properties
      @text = text
    end

    def self.parse(character_node)
      character = ParagraphRun.new
      character_node.xpath('*').each do |character_node_child|
        case character_node_child.name
        when 'rPr'
          character.properties = RunProperties.parse(character_node_child)
        when 't'
          character.text = character_node_child.text
        end
      end
      character
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/paragraph/paragraph_run.rb