From: Emmanuel Oga Date: 2007-09-26T08:50:39+09:00 Subject: Re: Using a block to configure/initialize a class Hi! thanks for you replies. I'm going to analyze them. For the moment i wanted to answer the question of the unnatural api. The reason i wan't to do it that way is because i'm not going to use String or array for most of the options, but Structs. So i want a way to let the user do this Struct.new "Value", :sub1, :sub2, :sub3 << In fact, the user may not even know about the Struct::Value class. class Options ...same as before... define_option :an_option end opt= Options.new opt.an_option do |o| o.sub1= ... o.sub2= ... o.sub3= ... end instead of an_option.sub1= ... an_option.sub2= ... an_option.sub3= ... -- Posted via http://www.ruby-forum.com/.