Shoud be easy - using hash key as a variable

So I've taken a break from programming for a couple years and trying
to get back into it, feeling quite like trying to ride a bike through
the mud.

What I'm trying to do is use a variable as a hash key, like so:

def time_advance(date,advance_by,unit)
   return date.to_time.advance({ advance_by => unit.to_i})

function being called would look something like this - time_advance
("Tue Aug 04 22:41:00 UTC 2009","weeks","3"), so the function being
called would look like this if I hard-wrote it in:

"Tue Aug 04 22:41:00 UTC 2009".to_time.advance({ :weeks => "3".to_i })

How do I do?