Returns:
273 274 275 276 277 278 279 280
# File 'lib/semantics3.rb', line 273 def self.is_json?(foo) begin return false unless foo.is_a?(String) JSON.parse(foo).all? rescue JSON::ParserError false end end