module JsonRender

Public Class Methods

convert(json) click to toggle source
# File lib/angus/renders/json_render.rb, line 3
def self.convert(json)
  if json.is_a?(String)
     json
   else
     JSON(json, :ascii_only => true)
   end
end
render(response, json) click to toggle source
# File lib/angus/renders/json_render.rb, line 11
def self.render(response, json)
  response['Content-Type'] = 'application/json'

  response.write(convert(json))
end