class OoxmlParser::TargetElement

Class for data for Target Element

Attributes

built_in[RW]
id[RW]
name[RW]
type[RW]

Public Class Methods

new(type = '', id = '', parent: nil) click to toggle source
Calls superclass method OoxmlParser::OOXMLDocumentObject::new
# File lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb, line 8
def initialize(type = '', id = '', parent: nil)
  @type = type
  @id = id
  super(parent: parent)
end

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb, line 17
def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'spTgt'
      @type = :shape
      @id = node_child.attribute('spid').value
    end
  end
  self
end