Sha256: c7d769ed0ac0a1ed81760833be76cdb37578334b8b785df1c9a5fab9adf65daf

Contents?: true

Size: 937 Bytes

Versions: 4

Compression:

Stored size: 937 Bytes

Contents

# frozen_string_literal: true

require_relative 'old_docx_shape_properties'
module OoxmlParser
  # Fallback DOCX shape data
  class OldDocxShape < OOXMLDocumentObject
    attr_accessor :properties, :text_box, :fill
    # @return [FileReference] image structure
    attr_accessor :file_reference

    # Parse OldDocxShape object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [OldDocxShape] result of parsing
    def parse(node)
      @properties = OldDocxShapeProperties.new(parent: self).parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'textbox'
          @text_box = TextBox.new(parent: parent).parse_list(node_child)
        when 'imagedata'
          @file_reference = FileReference.new(parent: self).parse(node_child)
        when 'fill'
          @fill = OldDocxShapeFill.new(parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb
ooxml_parser-0.37.0 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb
ooxml_parser-0.36.1 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb
ooxml_parser-0.36.0 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape.rb