Commit 3aa864b

mo khan <mo@mokhan.ca>
2015-04-08 20:38:02
add more shapes.
1 parent 214a6e5
lib/scale/shapes/line.rb
@@ -7,7 +7,7 @@ module Scale
     attribute :y2, Integer # the y position of point 2
 
     def xml_tag
-      :circle
+      :line
     end
   end
 end
lib/scale/shapes/path.rb
@@ -0,0 +1,10 @@
+module Scale
+  class Path
+    include Node
+    attribute :d, String
+
+    def xml_tag
+      :path
+    end
+  end
+end
lib/scale/shapes/polygon.rb
@@ -0,0 +1,10 @@
+module Scale
+  class Polygon
+    include Node
+    attribute :points, String
+
+    def xml_tag
+      :polyline
+    end
+  end
+end
lib/scale/shapes/polyline.rb
@@ -0,0 +1,10 @@
+module Scale
+  class Polyline
+    include Node
+    attribute :points, String
+
+    def xml_tag
+      :polyline
+    end
+  end
+end
lib/scale.rb
@@ -1,10 +1,13 @@
 require "scale/version"
 require "scale/node"
 require "scale/svg"
-require "scale/shapes/rectangle"
 require "scale/shapes/circle"
 require "scale/shapes/ellipse"
 require "scale/shapes/line"
+require "scale/shapes/path"
+require "scale/shapes/polygon"
+require "scale/shapes/polyline"
+require "scale/shapes/rectangle"
 require "scale/text"
 require "scale/dsl"