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

Here is my solution... noth...

364d0e86994a268906392f6b6146af38 Talk
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

by FrankLamontagne, April 17, 2008 00:20, 8 refactorings, tagged with rubyize-this, ruby, fun

Ouch... this guy badly need...

364d0e86994a268906392f6b6146af38 Talk
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 ...

364d0e86994a268906392f6b6146af38 Talk
1
2
3
4
class Bug
  attr_accessor :name,:type,:iq,:annoyance_factor
  def initialize(name="unname",type=:spider,iq=8,annoyance_factor=4)
...

Ruby On Rubyize this : 4th edition

by FrankLamontagne, October 23, 2007 14:28
364d0e86994a268906392f6b6146af38 Talk
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 ...

364d0e86994a268906392f6b6146af38 Talk
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 Star_fullStar_fullStar_full

A reversed approach...

364d0e86994a268906392f6b6146af38 Talk
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...

364d0e86994a268906392f6b6146af38 Talk