Permalink
Browse files

This is really the right fix for this. The colon syntax for "when"'s …

…is essentially gone due to the new hash syntax in 1.9.
  • Loading branch information...
1 parent 5e80fd7 commit 2c29755fd5c6c75f2797d6b5ef1e544b763bd54a @pmarreck pmarreck committed Aug 9, 2011
Showing with 4 additions and 4 deletions.
  1. +4 −4 lib/runt.rb
View
@@ -87,10 +87,10 @@ def ordinalize(number)
elsif (11..13).include?(number.to_i % 100)
"#{number}th"
else
- case "#{number.to_i%10}"
- when "1": "#{number}st"
- when "2": "#{number}nd"
- when "3": "#{number}rd"
+ case number.to_i%10
+ when 1 then "#{number}st"
+ when 2 then "#{number}nd"
+ when 3 then "#{number}rd"
else "#{number}th"
end
end

0 comments on commit 2c29755

Please sign in to comment.