Class: Consul::Utils
- Inherits:
-
Object
- Object
- Consul::Utils
- Defined in:
- lib/consul/util/utils.rb
Class Method Summary collapse
-
.valid_json?(json) ⇒ Boolean
Public verify this is valid json.
Class Method Details
.valid_json?(json) ⇒ Boolean
Public verify this is valid json
7 8 9 10 11 12 13 14 |
# File 'lib/consul/util/utils.rb', line 7 def self.valid_json?(json) begin JSON.parse(json) return true rescue Exception => e return false end end |