What's the correct way to do this with mod_ruby?

Is this:

Apache::request.status = 301
Apache::request.headers_out['location'] = "http://my.org/test/"

The same as this:
require 'cgi'
cgi = CGI.new
cgi.header(
'status' => '301 Moved Permantently',
'location' => 'http://my.org/test/'
)

Thanks,

John Long