class Phantom::SVG::Parser::XMLAnimationReader

AnimationReader for XML.

Private Instance Methods

read_parameter(path) click to toggle source

Read parameter from animation information file.

# File lib/phantom/parser/xml_animation_reader.rb, line 14
def read_parameter(path)
  xml = REXML::Document.new(open(path))

  animation = xml.elements['animation']
  return if animation.nil?

  animation.attributes.each do |key, val|
    set_parameter(key, val)
  end

  animation.elements.each('frame') do |element|
    add_frame_info(element.attributes['src'], element.attributes['delay'])
  end
end