module CartoJson class Rectangle def initialize(opts={}) raise "sw and ne coordinates are required" unless opts[:sw] && opts[:ne] @sw = opts[:sw].to_f @ne = opts[:ne].to_f raise "sw and ne coordinates cannot be equal" if @sw == @ne end def to_wkt end end end