Class: DYI::Formatter::SvgReader

Inherits:
Object
  • Object
show all
Defined in:
lib/dyi/formatter/svg_reader.rb

Overview

Since:

  • 0.0.0

Class Method Summary collapse

Class Method Details

.read(file_name) ⇒ Object

Since:

  • 0.0.0



31
32
33
34
35
36
37
38
# File 'lib/dyi/formatter/svg_reader.rb', line 31

def read(file_name)
  doc = REXML::Document.new(open(file_name))
  container = DYI::Shape::ShapeGroup.new
  doc.root.elements.each do |element|
    container.child_elements.push(create_shape(element))
  end
  container
end