class Numeric
To other
Public Instance Methods
ordinalize()
click to toggle source
# File lib/rocker.rb, line 77 def ordinalize n= self.to_s s= n[-2]=='1' ? 'th' : n[-1]=='1' ? 'st' : n[-1]=='2' ? 'nd' : n[-1]=='3' ? 'rd' : 'th' n + s end