]> git.openstreetmap.org Git - rails.git/blobdiff - lib/bounding_box.rb
Localisation updates from https://translatewiki.net.
[rails.git] / lib / bounding_box.rb
index e784342639c50c57056d5fac45dee8f989464345..e2dfcd3ff4b3d40c77fbffa3a5654e689a25a188 100644 (file)
@@ -3,8 +3,8 @@ class BoundingBox
 
   LON_LIMIT = 180.0
   LAT_LIMIT = 90.0
-  SCALED_LON_LIMIT = LON_LIMIT *  GeoRecord::SCALE
-  SCALED_LAT_LIMIT = LAT_LIMIT *  GeoRecord::SCALE
+  SCALED_LON_LIMIT = LON_LIMIT * GeoRecord::SCALE
+  SCALED_LAT_LIMIT = LAT_LIMIT * GeoRecord::SCALE
 
   public
 
@@ -16,16 +16,12 @@ class BoundingBox
   end
 
   def self.from_s(s)
-    if s.count(',') == 3
-      BoundingBox.new(*s.split(/,/))
-    else
-      nil
-    end
+    BoundingBox.new(*s.split(/,/)) if s.count(",") == 3
   end
 
   def self.from_bbox_params(params)
-    if params[:bbox] && params[:bbox].count(',') == 3
-      bbox_array = params[:bbox].split(',')
+    if params[:bbox] && params[:bbox].count(",") == 3
+      bbox_array = params[:bbox].split(",")
     end
     from_bbox_array(bbox_array)
   end