Class: String

Inherits:
Object show all
Defined in:
lib/noahutils.rb

Instance Method Summary collapse

Instance Method Details

#is_json?Boolean

Returns:

  • (Boolean)


2
3
4
5
6
7
8
# File 'lib/noahutils.rb', line 2

def is_json?
  begin
    !!JSON.parse(self)
  rescue
    false
  end
end