Commit 2ce6f77

mo khan <mo@mokhan.ca>
2015-04-08 17:41:36
extract common append_to interface.
1 parent 765509c
Changed files (1)
lib
scale
lib/scale/svg.rb
@@ -15,15 +15,19 @@ module Scale
 
     def to_xml
       builder = Nokogiri::XML::Builder.new do |xml|
-        xml.svg(attributes) do
-          @children.each do |node|
-            node.append_to(xml)
-          end
-        end
+        append_to(xml)
       end
       builder.to_xml
     end
 
+    def append_to(xml)
+      xml.svg(attributes) do
+        @children.each do |node|
+          node.append_to(xml)
+        end
+      end
+    end
+
     private
 
     def attributes