From: Stephen Cox Date: 2007-07-16T19:21:54+09:00 Subject: Re: Symbols Matthew Rudy wrote: > def do_stuff(message_type) > case message_type > when :email > do email stuff > when :sms > do sms stuff > end > puts "done stuff for #{message_type}" > end Thanks. but doing something like: email = 1 sms = 2 And then the same case statement. But instead of testing symbols you'd test variables. Same thing right? Except symbols can be used anywhere in the application? And may seem a more elegant approach to strings that everything needs access too. -- Posted via http://www.ruby-forum.com/.