Class: DevOrbit::Utils

Inherits:
Object
  • Object
show all
Defined in:
lib/dev_orbit/utils.rb

Class Method Summary collapse

Class Method Details

.valid_json?(string) ⇒ Boolean

Returns:

  • (Boolean)


5
6
7
8
9
# File 'lib/dev_orbit/utils.rb', line 5

def self.valid_json?(string)
  !JSON.parse(string).nil?
rescue JSON::ParserError
  false
end