From: Yvon Thoraval Date: 2006-07-20T20:30:05+09:00 Subject: Re: return statement where it is usefull ? --Apple-Mail-16--1005858575 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=ISO-8859-1; delsp=yes; format=flowed Le 20 juil. 06 =E0 13:16, Julian 'Julik' Tarkhanov a =E9crit : > As for your method, why not use a conditional assignment? =20 > Array#index returns nil when the element is not in the > array, so you can get a nil and suppress it with -1. > > def get_server_index(server) > self.servers.index(server) || -1 > end thanks very much, much more rubyish ;-)= --Apple-Mail-16--1005858575--