Sha256: c335b753855c37a6a318968d42b36be95c5217cc2439e2b8114c9e7ef27736ac

Contents?: true

Size: 993 Bytes

Versions: 3

Compression:

Stored size: 993 Bytes

Contents

# frozen_string_literal: true

require_relative 'transition/sound_action'
require_relative 'transition_properties/transition_properties'
module OoxmlParser
  # Class for data of Transition
  class Transition < OOXMLDocumentObject
    attr_accessor :speed, :properties, :sound_action, :advance_on_click, :delay, :duration

    def parse(node)
      node.xpath('*').each do |node_child|
        @properties = TransitionProperties.new(parent: self).parse(node_child)
        case node_child.name
        when 'sndAc'
          @sound_action = SoundAction.new(parent: self).parse(node_child)
        end
      end
      node.attributes.each do |key, value|
        case key
        when 'spd'
          @speed = value.value.to_sym
        when 'advClick'
          @advance_on_click = attribute_enabled?(value)
        when 'advTm'
          @delay = value.value.to_f / 1_000.0
        when 'dur'
          @duration = value.value.to_f / 1_000.0
        end
      end
      self
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ooxml_parser-0.6.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb
ooxml_parser-0.5.1 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb
ooxml_parser-0.5.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb