From: Patrick Doyle Date: 2008-12-24T01:51:19+09:00 Subject: Loading up a hash with variables if they are defined ------=_Part_55835_18777222.1230051597020 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline Is there a cleaner, more Rubyesque way to do this? # Return a hash of the navigation parameters def nav_params params = {} params[:prefix] = @prefix if @prefix params[:category_id] = @category_id if @category_id params[:page] = @page if @page params end I want to load a parameters hash with the contents of some instance variables, but only if they are defined. --wpd ------=_Part_55835_18777222.1230051597020--