module LogMagic::JSONUtils
Public Instance Methods
parse_json(json)
click to toggle source
# File lib/log_magic/utils/json_utils.rb, line 8 def parse_json(json) JSON.parse(json) end
pretty_print_json(json)
click to toggle source
# File lib/log_magic/utils/json_utils.rb, line 2 def pretty_print_json(json) JSON.pretty_generate(parse_json(json)) .gsub("\n", '<br>') .gsub(" ", ' ') end
query_hash()
click to toggle source
# File lib/log_magic/utils/json_utils.rb, line 12 def query_hash JSON.parse(query_json) end