ErrorDocument/CGI error code determination

Can a Ruby CGI program configured to be the ErrorDocument for 404
errors see what the requested invalid filename was? Thanks.