finally the right way to do a case statment in ruby.