Class: Helpers

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

Class Method Summary collapse

Class Method Details

.is_json_string(str) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/helpers/helpers.rb', line 5

def self.is_json_string(str)
    begin
        JSON.parse(str)
        return true
      rescue JSON::ParserError => e
        return false
      end
end