lib/terraformer/line_string.rb in terraformer-0.1.0 vs lib/terraformer/line_string.rb in terraformer-0.2.0
- old
+ new
@@ -1,8 +1,18 @@
module Terraformer
class LineString < Geometry
+ def initialize *args
+ super *args
+
+ # must be an array of coordinates
+ unless Array === coordinates &&
+ Terraformer::Coordinate === coordinates[0]
+ raise ArgumentError.new 'invalid coordinates for Terraformer::LineString'
+ end
+ end
+
def first_coordinate
coordinates[0]
end
def linear_ring?