Class: Phantom::SVG::Parser::SVGReader
- Inherits:
-
AbstractImageReader
- Object
- AbstractImageReader
- Phantom::SVG::Parser::SVGReader
- Defined in:
- lib/phantom/parser/svg_reader.rb
Overview
SVG reader.
Instance Attribute Summary
Attributes inherited from AbstractImageReader
#frames, #has_animation, #height, #loops, #skip_first, #width
Instance Method Summary collapse
-
#read(path, options = {}) ⇒ Object
Read svg file from path.
Methods inherited from AbstractImageReader
Constructor Details
This class inherits a constructor from Phantom::SVG::Parser::AbstractImageReader
Instance Method Details
#read(path, options = {}) ⇒ Object
Read svg file from path.
13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
# File 'lib/phantom/parser/svg_reader.rb', line 13 def read(path, = {}) reset return if path.nil? || path.empty? @root = REXML::Document.new(open(path)) if @root.elements['svg'].attributes['id'] == 'phantom_svg' read_animation_svg() @has_animation = true else read_svg() @has_animation = false end end |