Skip to content

Instantly share code, notes, and snippets.

@celldee
Created April 5, 2012 20:35
Show Gist options
  • Save celldee/2313898 to your computer and use it in GitHub Desktop.
Save celldee/2313898 to your computer and use it in GitHub Desktop.
Handy JSON validation method
require 'json'
def valid_json?(str)
begin
JSON.parse(str)
return true
rescue Exception => e
return false
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment