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


Trackback URI | Comments RSS

Leave a Reply

  • Recent Comments

    • carbonara72: Hi, This is a brilliant feature! I discovered LastBrigde.net a couple of days ago and was frustrated...
    • fernyb: @mike_rofone, I will kill your account, just a side note, I know it’s missing a feature to reset...
    • mike_rofone: Hey Dude, awesome work, it it’s set up it just works like a charm. Maybe I’m dumb but I...
    • mjm: Send me an invite? Thanx., mjm.ent -at- gmail
    • Steven Luscher: Awesome! Now what I’d really like is a way to scrobble tracks played on my SoundBridge…


My blog is worth $1,693.62.
How much is your blog worth?


Bad Behavior has blocked 204 access attempts in the last 7 days.

eastern-avalanche
eastern-avalanche
eastern-avalanche
eastern-avalanche