From: Yukihiro Matsumoto Date: 2006-12-01T22:21:45+09:00 Subject: Re: why does openstruct not respond to [] and []=? Hi, In message "Re: why does openstruct not respond to [] and []=?" on Fri, 1 Dec 2006 21:35:42 +0900, "Martin DeMello" writes: |{ | :verbose => ["-v", "--[no-]verbose", "run verbosely"], | :all => ["-A", "--all", "select all files"], | #.... |}.each {|k,v| opt.on(*v) {|i| opts.send(:"#{k}=", i) } } | |The last line would have been a lot less ugly as opts[k] = i, and as I |said, there seems no real reason not to allow it. Is there any reason that you have to use OpenStruct instead of plain hash as opts? matz.