lib/assistance/inflector.rb in assistance-0.1.2 vs lib/assistance/inflector.rb in assistance-0.1.3
- old
+ new
@@ -261,13 +261,17 @@
def ordinalize(number)
if (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"
- else "#{number}th"
+ when 1
+ "#{number}st"
+ when 2
+ "#{number}nd"
+ when 3
+ "#{number}rd"
+ else
+ "#{number}th"
end
end
end
end
\ No newline at end of file