Class: String
- Inherits:
-
Object
- Object
- String
- Defined in:
- lib/initializers/is_json.rb
Instance Method Summary collapse
Instance Method Details
#is_json? ⇒ Boolean
4 5 6 7 8 9 10 |
# File 'lib/initializers/is_json.rb', line 4 def is_json? begin !!JSON.parse(self) rescue false end end |