class CartesianForGeo::PolygonsCollection

Collection (Array) of Polygons

Public Instance Methods

<<(new_polygon) click to toggle source
Calls superclass method
# File lib/cartesian_for_geo.rb, line 7
def <<(new_polygon)
        each_with_index do |polygon, ind|
                if new_polygon.include?(polygon)
                        insert(ind, new_polygon) unless include?(new_polygon)
                        next new_polygon.concat delete(polygon)
                elsif polygon.include?(new_polygon)
                        break new_polygon = polygon.concat(new_polygon)
                end
        end
        return self if include?(new_polygon)
        super new_polygon
end