From: 520079130762-0001@... (Michael Neumann) Date: 2002-10-24T15:58:39+09:00 Subject: Re: Struct and symbols On Thu, 2002-10-24 at 08:42, Jean-Paul wrote: > Folks, > > I am new to Ruby and have a question about Struct. > > I have something like > > Record = Struct.new(:field1, :field2, :field3) > > How can I make the symbol list flexible and go from, say, > > s = ["field1", "field2", "field3"] to the above? That should work: symbols = s.map{|f| f.intern} Record = Struct.new(*symbols) Regards, Michael