Sha256: 6a2221bebc57da2e49e0ad43e50c811d2672db14b12e7106c2fccc1577bb580e

Contents?: true

Size: 951 Bytes

Versions: 8

Compression:

Stored size: 951 Bytes

Contents

# frozen_string_literal: true

require_relative 'target_element'
module OoxmlParser
  # Class for data for Behavior
  class Behavior < OOXMLDocumentObject
    attr_accessor :common_time_node, :attribute_name_list, :target

    def initialize(parent: nil)
      @attribute_name_list = []
      @parent = parent
    end

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

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
ooxml_parser-0.8.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.8.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.7.2 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.7.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.7.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.6.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.5.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb
ooxml_parser-0.5.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/behavior.rb