Sha256: d868fb9c09aa072cf8a8f980eb8cff558e9a6d181d2fddd10ccc7b608267667f

Contents?: true

Size: 250 Bytes

Versions: 12

Compression:

Stored size: 250 Bytes

Contents

require 'json'

module Consul
  class Utils

    # Public verify this is valid json
    def self.valid_json?(json)
      begin
        JSON.parse(json)
        return true
      rescue Exception => e
        return false
      end
    end

  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
consul-ruby-client-0.0.13 lib/consul/util/utils.rb
consul-ruby-client-0.0.12 lib/consul/util/utils.rb
consul-ruby-client-0.0.11 lib/consul/util/utils.rb
consul-ruby-client-0.0.10 lib/consul/util/utils.rb
consul-ruby-client-0.0.9 lib/consul/util/utils.rb
consul-ruby-client-0.0.8 lib/consul/util/utils.rb
consul-ruby-client-0.0.7 lib/consul/util/utils.rb
consul-ruby-client-0.0.6 lib/consul/util/utils.rb
consul-ruby-client-0.0.5 lib/consul/util/utils.rb
consul-ruby-client-0.0.4 lib/consul/util/utils.rb
consul-ruby-client-0.0.3 lib/consul/util/utils.rb
consul-ruby-client-0.0.2 lib/consul/util/utils.rb