1 2 3 4
class VotingSystem def vote(answer, question = "is 'the flinstones' a boring t.v. show?") if @@votes.has_key?(question.downcase) && @@votes[question.downcase].has_key?(answer.downcase) ...
Ruby On Rubyize this : 6th edition
by FrankLamontagne,
April 17, 2008 13:13
1 2 3 4
class VotingSystem #Hello, I am Rodger the old and unhappy programmer. the variable nbrOfVotes is an array of 2 dimensions. The first dimension contains the number of votes for the answer "YES, IT SUCKS"... and the other dimension contain the number of votes for the answer "NO, IT DOESN'T SUCK". In the near future there will be other possible answers... but I don't care! I retire in 2 days! @@nbrOfVotes = Array.new ...
Ruby Rubyize this : 6th edition
Ouch... this guy badly need...
1 2 3 4
@wordsToHighlight=["important","monkey","dancing"] def highlightText(input) for i in 0..@wordsToHighlight.length-1 do ...
Ruby Rubyize this : 5th edition
by FrankLamontagne,
January 03, 2008 13:33,
16 refactorings
Here is the 5th edition of ...
1 2 3 4
class Bug attr_accessor :name,:type,:iq,:annoyance_factor def initialize(name="unname",type=:spider,iq=8,annoyance_factor=4) ...
1 2 3 4
class Bug attr_accessor :type attr_accessor :name ...
Ruby Rubyize this : 4th edition
by FrankLamontagne,
October 23, 2007 12:26,
16 refactorings
Welcome to the 4th edition ...
1 2 3 4
def remove_insults(input) insults = ["stupid","moron","dumbass","retard"] insults.each { |insult| input.gsub!(insult,'*' * insult.length) } ...
Ruby On Rubyize this : 3rd edition
by FrankLamontagne,
October 11, 2007 16:40
A reversed approach...
1 2 3 4
def remove_insults(input) ctr = 0 input.each do |word| ...
Ruby Rubyize this : 3rd edition
by FrankLamontagne,
October 11, 2007 15:21,
10 refactorings
This snippet is coming from...

Here is my solution... noth...