From: Giles Bowkett Date: 2006-05-16T03:36:17+09:00 Subject: Re: Struct.new vs class is "*a" basically a keyword args flag that tells initialize() to take any and all args and just pass them up the chain to super()? On 5/15/06, Mark Volkmann wrote: > On 5/15/06, Mauricio Fernandez wrote: > > On Mon, May 15, 2006 at 09:43:20PM +0900, Mark Volkmann wrote: > > > What is this supposed to do? It doesn't seem to allow me to create a > > > Sample object and pass parameters to new. I think the OP wanted that. > > > > class Sample < Struct.new(:note_length, :sequence, :note, :channel) > > def initialize(*a) > > super > > # ... > > end > > end > > > > RUBY_VERSION # => "1.8.4" > > Sample.new(2, 3, 4, 5) # => # > > Ah! Your initialize method takes a "*a" parameter, but the original > example did not. That fixes it. Thanks! > > -- > R. Mark Volkmann > Object Computing, Inc. > > -- Giles Bowkett http://www.gilesgoatboy.org