From: Mark Volkmann Date: 2006-05-15T22:36:26+09:00 Subject: Re: Struct.new vs class 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.