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