Sha256: d4d42268d72fd5a4f25472196fdcbd30ba1ca7450fc0ee38ec9d4f3194ad0f62

Contents?: true

Size: 892 Bytes

Versions: 2

Compression:

Stored size: 892 Bytes

Contents

require_relative 'transition/transition'
module OoxmlParser
  class PresentationAlternateContent < OOXMLDocumentObject
    attr_accessor :transition, :timing, :elements

    def initialize(elements = [])
      @elements = elements
    end

    def self.parse(alternate_content_node)
      alternate_content = PresentationAlternateContent.new
      alternate_content_node.xpath('mc:Choice/*', 'xmlns:mc' => 'http://schemas.openxmlformats.org/markup-compatibility/2006').each do |choice_node_child|
        case choice_node_child.name
        when 'timing'
          alternate_content.timing = Timing.parse(choice_node_child)
        when 'transition'
          alternate_content.transition = Transition.parse(choice_node_child)
        when 'sp'
          alternate_content.elements << PresentationShape.parse(choice_node_child)
        end
      end
      alternate_content
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
ooxml_parser-0.1.2 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb
ooxml_parser-0.1.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/presentation_alternate_content.rb