Sha256: e9f2f5edab0313f2a787b5c4cc9eeadfe9cc3fd4bdf76ba422cc1714bc709d16

Contents?: true

Size: 626 Bytes

Versions: 2

Compression:

Stored size: 626 Bytes

Contents

module OoxmlParser
  class TextBody
    attr_accessor :properties, :paragraphs

    def initialize(properties = nil, paragraphs = [])
      @properties = properties
      @paragraphs = paragraphs
    end

    def self.parse(text_body_node)
      text_body = TextBody.new
      text_body_node.xpath('*').each do |text_body_node_child|
        case text_body_node_child.name
        when 'p'
          text_body.paragraphs << Paragraph.parse(text_body_node_child)
        when 'bodyPr'
          text_body.properties = OOXMLShapeBodyProperties.parse(text_body_node_child)
        end
      end
      text_body
    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/alternate_content/shape/text_body/text_body.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/shape/text_body/text_body.rb