Skip to content

Commit

Permalink
refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
melborne committed Nov 8, 2010
1 parent 1619fdb commit e59bde4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions irc.rb
Expand Up @@ -26,9 +26,9 @@
s = [str.chars, str.split(/\b/), str.split(/\b/).reverse][rand(3)]
puts s.inject("") { |mem, chr| mem << chr.send(C[rand(C.length)]) }
else
attrs = line.split(/[,\s]+/)
raise unless attrs.all? { |attr| ATTRS.include? attr.intern }
puts attrs.inject(str) { |mem, color| mem.send color }
inputs = line.split(/[,\s]+/)
raise unless (inputs.map(&:intern) - ATTRS).empty?
puts inputs.inject(str) { |mem, color| mem.send color }
end
rescue
puts "is that color?"
Expand Down

0 comments on commit e59bde4

Please sign in to comment.