class OoxmlParser::DocxShapeProperties

DOCX Shape Properties

Attributes

blip_fill[R]

@return [BlipFill] BlipFill data

custom_geometry[R]

@return [PresetGeometry] is some geometry custom

fill[R]

@return [DocxColor] color of object

fill_color[R]

@return [DocxColor] color of object

line[R]

@return [DocxShapeLine] line info

preset[R]

@return [PresetGeometry] preset geometry of object

preset_geometry[R]

@return [PresetGeometry] preset geometry of object

shape_size[R]

@return [DocxShapeSize] size of shape

transform[R]

@return [DocxShapeSize] size of shape

Public Class Methods

new(parent: nil) click to toggle source
Calls superclass method
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb, line 30
def initialize(parent: nil)
  @line = DocxShapeLine.new
  super
end

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/docx_shape_properties.rb, line 38
def parse(node)
  @fill_color = DocxColor.new(parent: self).parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'xfrm'
      @shape_size = DocxShapeSize.new(parent: self).parse(node_child)
    when 'prstGeom'
      @preset_geometry = PresetGeometry.new(parent: self).parse(node_child)
    when 'ln'
      @line = DocxShapeLine.new(parent: self).parse(node_child)
    when 'blipFill'
      @blip_fill = BlipFill.new(parent: self).parse(node_child)
    when 'custGeom'
      @preset_geometry = PresetGeometry.new(parent: self).parse(node_child)
      @preset_geometry.name = :custom
      @custom_geometry = OOXMLCustomGeometry.new(parent: self).parse(node_child)
    end
  end
  self
end