Sha256: 32f6824aeaef63734e7317df0469d7907de43ae7c53342fe72aa171e4bc673f6

Contents?: true

Size: 926 Bytes

Versions: 4

Compression:

Stored size: 926 Bytes

Contents

module OoxmlParser
  # Fallback DOCX shape fill properties
  class OldDocxShapeFill < OOXMLDocumentObject
    attr_accessor :stretching_type, :opacity, :title
    # @return [FileReference] image structure
    attr_accessor :file_reference

    # Parse OldDocxShapeFill object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [OldDocxShapeFill] result of parsing
    def parse(node)
      node.attributes.each do |key, value|
        case key
        when 'id'
          @file_reference = FileReference.new(parent: self).parse(node)
        when 'type'
          @stretching_type = case value.value
                             when 'frame'
                               :stretch
                             else
                               value.value.to_sym
                             end
        when 'title'
          @title = value.value.to_s
        end
      end
      self
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb
ooxml_parser-0.4.0 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb
ooxml_parser-0.3.0 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb
ooxml_parser-0.2.0 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb