From: Sean Hussey Date: 2006-11-11T01:14:20+09:00 Subject: Re: Spliting a line and passing the results I guess I'd just rather not depend on the order of the fields in the file always being the same. If they change, I can change the split(...), but I won't have to change new or update. (I may want to, but I won't have to based on file format.) Does that make sense? Or is that not a good enough reason? I'm looking for any advice people might have on style. Thanks! Sean On 11/10/06, Robert Klemme wrote: > On 10.11.2006 04:45, Sean Hussey wrote: > > On 11/9/06, Jan Svitok wrote: > >> KEYS = %w[ name id phone color temperature dog password ] > >> > >> data = line.chomp.split(...) > >> hash = Hash[*(KEYS.zip(data))] > > I am not sure what you actually gain with this - unless of course your > new and update methods would need to be rewritten to accept a Hash > because all arguments are optional. > > Kind regards > > robert > >