lib/terraformer/multi_point.rb in terraformer-0.1.0 vs lib/terraformer/multi_point.rb in terraformer-0.2.0
- old
+ new
@@ -7,9 +7,15 @@
when Point === args[0]
self.coordinates = args.map &:coordinates
else
super *args
end
+
+ # must be an array of coordinates
+ unless Array === coordinates &&
+ Terraformer::Coordinate === coordinates[0]
+ raise ArgumentError.new 'invalid coordinates for Terraformer::MultiPoint'
+ end
end
def first_coordinate
coordinates[0]
end