class OoxmlParser::ImageFill

Class for working with Image Fill

Attributes

file_reference[RW]

@return [FileReference] image structure

properties[RW]
stretch[RW]
tile[RW]

Public Class Methods

new(parent: nil) click to toggle source
Calls superclass method
# File lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb, line 11
def initialize(parent: nil)
  @path = ''
  super
end

Public Instance Methods

parse(node) click to toggle source

Parse ImageFill object @param node [Nokogiri::XML:Element] node to parse @return [ImageFill] result of parsing

# File lib/ooxml_parser/common_parser/common_data/colors/image_fill.rb, line 19
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.new(parent: self).parse(node_child, x_attr: 'tx', y_attr: 'ty'),
                       OOXMLCoordinates.new(parent: self).parse(node_child, x_attr: 'sx', y_attr: 'sy'),
                       parent: self).parse(node_child)
    end
  end
  self
end