class OoxmlParser::Behavior

Class for data for Behavior

Attributes

attribute_name_list[RW]
common_time_node[RW]
target[RW]

Public Class Methods

new(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/behavior.rb, line 9
def initialize(parent: nil)
  @attribute_name_list = []
  super
end

Public Instance Methods

parse(node) click to toggle source

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

# File lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb, line 17
def parse(node)
  node.xpath('*').each do |node_child|
    case node_child.name
    when 'cTn'
      @common_time_node = CommonTiming.new(parent: self).parse(node_child)
    when 'tgtEl'
      @target = TargetElement.new(parent: self).parse(node_child)
    when 'attrNameLst'
      node_child.xpath('p:attrName').each do |attribute_name_node|
        @attribute_name_list << attribute_name_node.text
      end
    end
  end
  self
end