Class: String

Inherits:
Object
  • Object
show all
Defined in:
lib/brewser/json-validation.rb

Instance Method Summary collapse

Instance Method Details

#valid_json?Boolean

Returns:

  • (Boolean)


4
5
6
7
8
9
10
11
# File 'lib/brewser/json-validation.rb', line 4

def valid_json?
  begin
    MultiJson.decode(self)
    return true
  rescue Exception => e
    return false
  end
end