Module: JSON
- Defined in:
- lib/semantics3.rb
Class Method Summary collapse
Class Method Details
.is_json?(foo) ⇒ Boolean
293 294 295 296 297 298 299 300 |
# File 'lib/semantics3.rb', line 293 def self.is_json?(foo) begin return false unless foo.is_a?(String) JSON.parse(foo).all? rescue JSON::ParserError false end end |