Ruby Code Snippet

Posted in Programming, Ruby on Jan 13, 2008

In Ruby a switch statement looks like this

say = "Hello"

case say
when "Hello" then
	puts "Say Hello"
when "Bye" then
	puts "Say Bye"
end

In PHP a switch statement looks like this


Comments are closed.

  • Recent Comments