From: Stefano Crocco Date: 2007-08-22T19:57:19+09:00 Subject: Re: how to dump contents of an array as parameters Alle mercoled狸 22 agosto 2007, Akif Tokuz ha scritto: > Hi > 脹 am a beginner Rubyist and I have a small problem. > > > Track=Struct.new(:name,:surname) > > #This works perfectly > tempTrack=Track.new(15,"b") > p tempTrack.name > p tempTrack.surname > > > But I want to create a temptrack with an incoming array how can i > convert > > [15,"b"] in to 15,"b" > > > #And of course this doesnt work > incomingArray=[15,"b"] > tempTrack=Track.new(incomingArray) > p tempTrack.name > p tempTrack.surname > > Thanks. > Akif, You need to do this: Track.new(*[15, 'b']) I hope this helps Stefano