class OoxmlParser::CommonNonVisualProperties

Class for `cNvPr` data

Attributes

description[RW]

@return [String] description of shape

id[RW]
name[RW]
title[RW]

@return [String] title of shape

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb, line 15
def parse(node)
  node.attributes.each do |key, value|
    case key
    when 'name'
      @name = value.value
    when 'id'
      @id = value.value
    when 'title'
      @title = value.value
    when 'descr'
      @description = value.value
    end
  end

  node.xpath('*').each do |node_child|
    case node_child.name
    when 'hlinkClick'
      @on_click_hyperlink = Hyperlink.new(parent: self).parse(node_child)
    when 'hlinkHover'
      @hyperlink_for_hover = Hyperlink.new(parent: self).parse(node_child)
    end
  end
  self
end