From: "Simon Kröger" Date: 2007-08-04T07:39:58+09:00 Subject: Re: cleaner way? Kyle Schmitt schrieb: > I'll first admit this is a lot cleaner and more succinct than my first > pass of it... but well > Is there a way to make this case and send block clearer and cleaner? I would only resort to #send and friends if neccessarity occurs: ------------------------------------------------------------------- def convert value, type case type.to_sym when :textField,:text_field then value.clone when :text,:t,:value then value.value when :html then value.html else value end end def getProperties type = :textField { :name => convert(@ie.text_field(:id, /EnvironmentTextEdit/), type), :start => convert(@ie.text_field(:id, /StartYearEdit/), type), :years => convert(@ie.text_field(:id, /NumberOfYearsEdit/), type) } end ------------------------------------------------------------------- thats much more pleasing to my eye, but YMMV cheers Simon