Sha256: 979098ea3b195aedcaf44d8bf573a454c2b719d132d05722b3a3637bb0a982af

Contents?: true

Size: 1.1 KB

Versions: 4

Compression:

Stored size: 1.1 KB

Contents

module OoxmlParser
  # Class for `cNvPr` data
  class CommonNonVisualProperties < OOXMLDocumentObject
    attr_accessor :name, :id, :on_click_hyperlink, :hyperlink_for_hover
    # @return [String] title of shape
    attr_accessor :title
    # @return [String] description of shape
    attr_accessor :description

    # Parse CommonNonVisualProperties object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [CommonNonVisualProperties] result of parsing
    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
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
ooxml_parser-0.4.1 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb
ooxml_parser-0.4.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb
ooxml_parser-0.3.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb
ooxml_parser-0.2.0 lib/ooxml_parser/common_parser/common_data/alternate_content/drawing/graphic/shape/docx_shape/non_visual_shape_properties/common_non_visual_properties.rb