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 28 29 30 31 |
# File 'lib/phantom/parser/svg_reader.rb', line 13 def read(path, = {}) reset return if path.nil? || path.empty? @path = path @marker = Digest::MD5.hexdigest(open(@path).read) @root = REXML::Document.new(open(path)) make_ids_unique() if [:unique_ids] == true if @root.elements['svg'].attributes['id'] == 'phantom_svg' read_animation_svg() @has_animation = true else read_svg() @has_animation = false end end |