Sha256: 78b2ad98e12622101296ee22f6c0943b128346affe393c613ea05a4c12eec85e

Contents?: true

Size: 1.1 KB

Versions: 45

Compression:

Stored size: 1.1 KB

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

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

45 entries across 45 versions & 1 rubygems

Version Path
ooxml_parser-0.37.1 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.37.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.36.1 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.36.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.35.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.34.2 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.34.1 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.34.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.33.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.32.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.31.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.30.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.29.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.28.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.27.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.26.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.25.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.24.0 lib/ooxml_parser/pptx_parser/presentation/slide/transition/transition.rb
ooxml_parser-0.23.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb
ooxml_parser-0.22.0 lib/ooxml_parser/pptx_parser/pptx_data/presentation/slide/transition/transition.rb