self.format

in lib/twurl/request_controller.rb [33:39]


    def self.format(string)
      json = JSON.parse(string)
      (json.is_a?(Array) || json.is_a?(Hash)) ? JSON.pretty_generate(json) : string
    rescue JSON::ParserError, TypeError
      string
    end