Class: OoxmlParser::CommonNonVisualProperties

Inherits:
OOXMLDocumentObject show all
Defined in:
lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb

Overview

Class for cNvPr data

Instance Attribute Summary collapse

Attributes inherited from OOXMLDocumentObject

#parent

Instance Method Summary collapse

Methods inherited from OOXMLDocumentObject

#==, add_to_xmls_stack, copy_file_and_rename_to_zip, current_xml, dir, encrypted_file?, get_link_from_rels, #initialize, unzip_file, #with_data?

Methods included from OoxmlDocumentObjectHelper

#to_hash

Constructor Details

This class inherits a constructor from OoxmlParser::OOXMLDocumentObject

Instance Attribute Details

#descriptionString

Returns description of shape.

Returns:

  • (String)

    description of shape



8
9
10
# 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 8

def description
  @description
end

Returns the value of attribute hyperlink_for_hover.



4
5
6
# 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 4

def hyperlink_for_hover
  @hyperlink_for_hover
end

#idObject

Returns the value of attribute id.



4
5
6
# 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 4

def id
  @id
end

#nameObject

Returns the value of attribute name.



4
5
6
# 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 4

def name
  @name
end

Returns the value of attribute on_click_hyperlink.



4
5
6
# 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 4

def on_click_hyperlink
  @on_click_hyperlink
end

#titleString

Returns title of shape.

Returns:

  • (String)

    title of shape



6
7
8
# 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 6

def title
  @title
end

Instance Method Details

#parse(node) ⇒ CommonNonVisualProperties

Parse CommonNonVisualProperties object

Parameters:

  • node (Nokogiri::XML:Element)

    node to parse

Returns:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
# 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 13

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 = HyperlinkForHover.new(parent: self).parse(node_child)
    end
  end
  self
end