class OoxmlParser::SizeRelativeHorizontal

Class for parsing `wp14:sizeRelH` object

Attributes

relative_from[RW]

@return [Symbol] type from which is relative

width[RW]

@return [PictureWidth] width class

Public Instance Methods

parse(node) click to toggle source

Parse SizeRelativeHeight @param [Nokogiri::XML:Node] node with SizeRelativeHeight @return [SizeRelativeHorizontal] result of parsing

# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/drawing_properties/size_relative_horizontal.rb, line 15
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'relativeFrom'
      @relative_from = value_to_symbol(value)
    end
  end

  node.xpath('*').each do |preset_geometry_child|
    case preset_geometry_child.name
    when 'pctWidth'
      @width = PictureDimension.new(parent: self).parse(preset_geometry_child)
    end
  end

  self
end