Fun with Ruby

Some of you may know that I like to play around with other programming languages, one of those being Ruby. I came across a t-shirt the other day and thought it was pretty funny. I modified it just a tad so you can run it from the console. Here it is:


class Programmer
def initialize(language)
@language
= language
end
def happy?
@language
=~ /ruby/ ? true : false
end
def make_happy!
puts @language
= 'Ruby'
end
end
you
= Programmer.new(gets)
unless you.happy?
you.make_happy!
end

Related posts

Add comment


(Will show your Gravatar icon)  

  Country flag

[b][/b] - [i][/i] - [u][/u]- [quote][/quote]



Live preview

December 5. 2008 03:57 AM

Twitter

    Search

    Disclaimer

    The opinions expressed herein are my own personal opinions and do not represent my employer's view in anyway.

    © Copyright 2008