Returns:
294 295 296 297 298 299 300 301
# File 'lib/semantics3.rb', line 294 def self.is_json?(foo) begin return false unless foo.is_a?(String) JSON.parse(foo).all? rescue JSON::ParserError false end end