module Roda::RodaPlugins::Json::RequestMethods

def block_result_body(result)

application/json content-type.
convert the result to json and return it as the body, using the
If the result is an instance of one of the json_result_classes,
def block_result_body(result)
  case result
  when *roda_class.json_result_classes
    response[CONTENT_TYPE] = APPLICATION_JSON
    convert_to_json(result)
  else
    super
  end
end

def convert_to_json(obj)

but can be overridden to use a different implementation.
Convert the given object to JSON. Uses to_json by default,
def convert_to_json(obj)
  obj.to_json
end