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

    • Salvador Leconey: Wassup thanks for the post.
    • Mauro Kofa: Very Nice article. Also, loving the blog design. I had a similar blog to yours before I sold it on.
    • Ahmed: @fernyb.. Thanks man! I forked the project, but I am newbie in open source, and don’t know where to...
    • fernyb: @Ahmed, yeah you can help. It’s hosted on (http://github.com/fernyb/Cupc ake) so you can also fork it...
    • Ahmed: And hey! Can I help with your new PHP framework? plssssssssss :( (

    Recent Listened to Tracks

    Loading...

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

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