Method: Integer#ordinal

Defined in:
motion/core_ext/integer/inflections.rb

#ordinalObject

Ordinal returns the suffix used to denote the position in an ordered sequence such as 1st, 2nd, 3rd, 4th.

1.ordinal     # => "st"
2.ordinal     # => "nd"
1002.ordinal  # => "nd"
1003.ordinal  # => "rd"
-11.ordinal   # => "th"
-1001.ordinal # => "st"


24
25
26
# File 'motion/core_ext/integer/inflections.rb', line 24

def ordinal
  MotionSupport::Inflector.ordinal(self)
end