Permalink
Browse files

Rename "count" API parameter to "limit"

  • Loading branch information...
1 parent bd4718a commit 40561da1f4581816b58fd3c6c71098723c9468e5 @mistydemeo committed Aug 20, 2012
Showing with 9 additions and 9 deletions.
  1. +6 −6 app.rb
  2. +3 −3 helpers.rb
View
12 app.rb
@@ -28,9 +28,9 @@
return invalid_query_response
end
- validate_count
+ validate_limit
- return search_response_for Items.where(:item => params["q"]).limit params["count"]
+ return search_response_for Items.where(:item => params["q"]).limit params["limit"]
end
get "/lost/searchlost" do
@@ -39,9 +39,9 @@
return invalid_query_response
end
- validate_count
+ validate_limit
- return search_response_for LostItem.where(:item => params["q"]).limit params["count"]
+ return search_response_for LostItem.where(:item => params["q"]).limit params["limit"]
end
get "/lost/searchfound" do
@@ -50,9 +50,9 @@
return invalid_query_response
end
- validate_count
+ validate_limit
- return search_response_for FoundItem.where(:item => params["q"]).limit params["count"]
+ return search_response_for FoundItem.where(:item => params["q"]).limit params["limit"]
end
# This should really be POST, but Poignant Guide's API didn't distinguish
View
@@ -3,9 +3,9 @@ def json_requested?
params["format"] == "json"
end
- def validate_count
- if not (params["count"] && params["count"] < 100 && params["count"] > 0)
- params["count"] = 10
+ def validate_limit
+ if not (params["limit"] && params["limit"] < 100 && params["limit"] > 0)
+ params["limit"] = 10
end
end

0 comments on commit 40561da

Please sign in to comment.