In article <483F26CE.1090106 / comcast.net>, "S.D" <s.d / comcast.net> 
wrote:

> def getTypes(grp_type)
>   res_types=Hash.new
>   if(!grp_type) then

Only FalseClass and NilClass are false in Ruby, so if it can be an empty 
string you need to check that differently

>      @types

Since the if/end is not the last expression in the function this will 
never be returned as a value. Use explicit return.

>   else
>     if(groups.has_key?(grp_type)) then
>       types.each do |k,v|
>         if(groups[grp_type].has_value?(v)) then
>           res_types[k]=v
>         end
>       end
>     else
>       res_types=false
>     end
>   end
>   res_types
> end

You might be better off rewriting from scratch than translating from 
PHP. You could start by documenting what the functions *do* ;)

-- 
  Tobias Weber