class OoxmlParser::DocxShapeLinePath

Docx Shape Line Path

Attributes

elements[RW]
fill[RW]
height[RW]
stroke[RW]
width[RW]

Public Class Methods

new(elements = [], parent: nil) click to toggle source
Calls superclass method
# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb, line 9
def initialize(elements = [], parent: nil)
  @elements = elements
  super(parent: parent)
end

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/shape_properties/custom_geometry/docx_custom_geometry/docx_shape_line_path.rb, line 17
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'w'
      @width = value.value.to_f
    when 'h'
      @height = value.value.to_f
    when 'stroke'
      @stroke = value.value.to_f
    end
  end
  node.xpath('*').each do |node_child|
    @elements << DocxShapeLineElement.new(parent: self).parse(node_child)
  end
  self
end