Sha256: 31ef94c54d9018da15993660f725c187c437e328e1e0f1a776bd5cef9987dda1

Contents?: true

Size: 859 Bytes

Versions: 2

Compression:

Stored size: 859 Bytes

Contents

# Fallback DOCX shape fill properties
module OoxmlParser
  class OldDocxShapeFill < OOXMLDocumentObject
    attr_accessor :path_to_image, :stretching_type, :opacity, :title

    def self.parse(fill_node)
      fill = OldDocxShapeFill.new
      fill_node.attributes.each do |key, value|
        case key
        when 'id'
          fill.path_to_image = OOXMLDocumentObject.copy_media_file(OOXMLDocumentObject.root_subfolder + get_link_from_rels(value.value))
        when 'type'
          fill.stretching_type = case value.value
                                 when 'frame'
                                   :stretch
                                 else
                                   value.value.to_sym
                                 end
        when 'title'
          fill.title = value.value.to_s
        end
      end
      fill
    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/picture/shape/old_docx_shape_fill.rb
ooxml_parser-0.1.1 lib/ooxml_parser/common_parser/common_data/alternate_content/picture/shape/old_docx_shape_fill.rb