class ActionDispatch::RequestEncoder
def initialize(mime_name, param_encoder, response_parser)
def initialize(mime_name, param_encoder, response_parser) @mime = Mime[mime_name] unless @mime raise ArgumentError, "Can't register a request encoder for " \ "unregistered MIME Type: #{mime_name}. See `Mime::Type.register`." end @response_parser = response_parser || -> body { body } @param_encoder = param_encoder || :"to_#{@mime.symbol}".to_proc end