From: Joel VanderWerf Date: 2009-05-15T06:48:57+09:00 Subject: Re: BitStruct technique Chuck Remes wrote: > def initialize message > # parens on #super are important so no args > # are passed up to the parent; if this part fails > # then you missed > super() do |struct| > struct.context = message[:a] > struct.password = message[:b] > struct.usr_name = message[:c] If you add this line here: yield struct if block_given? then the block initialization can still be used by subclasses or by the caller of #new: c = C.new hsh do |struct| struct.context = 2 end -- vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407