Sha256: d9bc830501b1ef29eab54616c411c6201e612baba928b2fa388bead7bd24e5a1

Contents?: true

Size: 675 Bytes

Versions: 8

Compression:

Stored size: 675 Bytes

Contents

# frozen_string_literal: true

module OoxmlParser
  # Class for data for Target Element
  class TargetElement < OOXMLDocumentObject
    attr_accessor :type, :id, :name, :built_in

    def initialize(type = '', id = '', parent: nil)
      @type = type
      @id = id
      @parent = parent
    end

    # Parse TargetElement object
    # @param node [Nokogiri::XML:Element] node to parse
    # @return [TargetElement] result of parsing
    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
  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/target_element.rb
ooxml_parser-0.8.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.7.2 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.7.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.7.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.6.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.5.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb
ooxml_parser-0.5.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/slide/timing/set_time_node/behavior/target_element.rb