Sha256: 47f94eb0882fc2b8e51dc88be177e1b6136c6291bdf4b4dfdf2dd058ffa69030

Contents?: true

Size: 864 Bytes

Versions: 2

Compression:

Stored size: 864 Bytes

Contents

require_relative 'shape_properties/docx_shape_properties'
require_relative 'shape_body_properties/ooxml_shape_body_properties'
# Docx Shape Data
module OoxmlParser
  class DocxShape < OOXMLDocumentObject
    attr_accessor :non_visual_properties, :properties, :style, :body_properties, :text_body

    def self.parse(shape_node)
      shape = DocxShape.new
      shape_node.xpath('*').each do |shape_node_child|
        case shape_node_child.name
        when 'spPr'
          shape.properties = DocxShapeProperties.parse(shape_node_child)
        when 'txbx'
          shape.text_body = OOXMLTextBox.parse(shape_node_child)
        when 'txBody'
          shape.text_body = TextBody.parse(shape_node_child)
        when 'bodyPr'
          shape.body_properties = OOXMLShapeBodyProperties.parse(shape_node_child)
        end
      end
      shape
    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/drawing/graphic/shape/docx_shape.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape.rb