Sha256: 7ff41591ddec59ccd60b1e6b34c8223f5009df13aa3b424879ce39391ea10616
Contents?: true
Size: 332 Bytes
Versions: 27
Compression:
Stored size: 332 Bytes
Contents
class Integer def ordinal if [11,12,13].include?(self % 100) "#{self}th" else case (self % 10) when 1 "#{self}st" when 2 "#{self}nd" when 3 "#{self}rd" else "#{self}th" end end end # Rails term. alias_method :ordinalize, :ordinal end
Version data entries
27 entries across 26 versions & 3 rubygems