Sha256: d05c4916a45fd825840fb0b0f4b0e1c84ebd39ef2fdaad394403785576cea1d5

Contents?: true

Size: 981 Bytes

Versions: 32

Compression:

Stored size: 981 Bytes

Contents

# frozen_string_literal: true

require_relative 'tile'
module OoxmlParser
  # Class for working with Image Fill
  class ImageFill < OOXMLDocumentObject
    attr_accessor :stretch, :tile, :properties
    # @return [FileReference] image structure
    attr_accessor :file_reference

    def initialize(parent: nil)
      @path = ''
      super
    end

    # Parse ImageFill object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [ImageFill] result of parsing
    def parse(node)
      node.xpath('*').each do |node_child|
        case node_child.name
        when 'blip'
          @file_reference = FileReference.new(parent: self).parse(node_child)
        when 'tile'
          @tile = Tile.new(OOXMLCoordinates.parse(node_child, x_attr: 'tx', y_attr: 'ty'),
                           OOXMLCoordinates.parse(node_child, x_attr: 'sx', y_attr: 'sy'),
                           parent: self).parse(node_child)
        end
      end
      self
    end
  end
end

Version data entries

32 entries across 32 versions & 1 rubygems

Version Path
ooxml_parser-0.33.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.32.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.31.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.30.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.29.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.28.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.27.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.26.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.25.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.24.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.23.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.22.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.21.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.20.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.19.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.18.1 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.18.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.17.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.16.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb
ooxml_parser-0.15.0 lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb