Skip to content

Instantly share code, notes, and snippets.

@blairanderson
Created February 28, 2013 00:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save blairanderson/5053141 to your computer and use it in GitHub Desktop.
Save blairanderson/5053141 to your computer and use it in GitHub Desktop.
look at this
def process_params(params)
@identifier = params[:identifier]
@rooturl = params[:rootUrl]
if missing_parameters?(params)
halt 400, "Bad Request! missing required parameters"
else
"#{{identifier: @identifier}.to_json}"
end
end
def missing_parameters?(params)
identifier = params[:identifier]
root = params[:rootUrl]
if identifier == nil || identifier == ""
true
elsif root == nil || root == ""
true
else
false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment