Method: Longbow.json_object_from_string

Defined in:
lib/longbow/json.rb

.json_object_from_string(contents) ⇒ Object



33
34
35
36
37
38
39
40
41
# File 'lib/longbow/json.rb', line 33

def self.json_object_from_string contents
  begin
    !!JSON.parse(contents)
  rescue
    return nil
  end

  return JSON.parse(contents)
end