lib/inout.rb
# Parses the representation sent in the request body
#
# If tolerant is set to true, will simply return nil when it fails to parse
# the incoming representation.
#
Parses the representation sent in the request body
If tolerant is set to true, will simply return nil when it fails to parse
the incoming representation.
Parses the representation sent in the request body If tolerant is set to true will simply return nil when it fails to parse the incoming representation .
def rparse (type, tolerant=false)
    request.body.rewind
    representation = request.body.read
    format = determine_in_format
    begin
      send("parse_#{type}_#{format}", representation)
    rescue Exception => e
      return nil if tolerant
      throw :done, [ 400, "failed to parse incoming representation" ]
    end
  end
def rparse ( type , tolerant = false ) request . body . rewind representation = request . body . read format = determine_in_format begin send ( "parse_#{type}_#{format}" , representation ) rescue Exception => e return nil if tolerant throw :done , [ 400 , "failed to parse incoming representation" ] end end
Parses the representation sent in the request body
If tolerant is set to true, will simply return nil when it fails to parse
the incoming representation.
Parses the representation sent in the request body If tolerant is set to true will simply return nil when it fails to parse the incoming representation .
#p [ "parse_#{type}_#{format}", representation ]
type
<not_specific>
tolerant
<not_specific>