From: Sean O'Halpin Date: 2006-07-29T00:32:15+09:00 Subject: Re: Using a '-' in a Key name in a Hash On 7/28/06, Andrew Knott wrote: > Hi, > > This a ruby question but it comes up in the context of Rails, hope that > is OK. > > I am trying to to consume a web service that has a structure element > called 'remote-ip'. (as below) > > result = server.call("IsValid", > {:username=>"me",:password=>"pass",:remote-ip=>request.remote_ip},@formattednumber) > > > This ofcourse doesn't work right now because I can't have a '-' in a key > name? Is there any way around this or am I screwed? > > thanks so much for any help. > > Andrew > To include non-identifier characters in a symbol, use the quoted form, i.e. :"remote-ip" => request.remote_ip Regards, Sean