lib/ury_rapid/server/helpers/model.rb
def parse_json_from(string)
          json = JSON.parse(string)
        rescue JSON::ParserError
          error(400, 'Badly formed JSON.')
        else
          json.deep_symbolize_keys!
        end
# Parses the request body as JSON and throws a 400 status if it
# is malformed.
#
# request - The request whose body is to be parsed.
#
# Yields the parsed request body.
#
# Returns the block's return value if the JSON is valid, and nothing
#   otherwise (processing is halted).
Parses the request body as JSON and throws a 400 status if it
is malformed.

The request whose body is to be parsed.

Yields the parsed request body.

Returns the block's return value if the JSON is valid, and nothing
otherwise (processing is halted).
Parses the request body as JSON and throws a 400 status if it is malformed . The request whose body is to be parsed . Yields the parsed request body . Returns the block ' s return value if the JSON is valid and nothing otherwise ( processing is halted ) .
def parse_json_from(string)
          json = JSON.parse(string)
        rescue JSON::ParserError
          error(400, 'Badly formed JSON.')
        else
          json.deep_symbolize_keys!
        end
def parse_json_from ( string ) json = JSON . parse ( string ) rescue JSON :: ParserError error ( 400 , 'Badly formed JSON.' ) else json . deep_symbolize_keys! end
Parses the request body as JSON and throws a 400 status if it
is malformed.
Parses the request body as JSON and throws a 400 status if it is malformed .
string