Sha256: ce4f710dd96e37a855688933ad3915e5f172ff5924e4a773e73d40f181cde109
Contents?: true
Size: 793 Bytes
Versions: 14
Compression:
Stored size: 793 Bytes
Contents
class Integer # Ordinalize turns a number into an ordinal string used to denote the # position in an ordered sequence such as 1st, 2nd, 3rd, 4th. # # 1.ordinalize # => "1st" # 2.ordinalize # => "2nd" # 1002.ordinalize # => "1002nd" # 1003.ordinalize # => "1003rd" # -11.ordinalize # => "-11th" # -1001.ordinalize # => "-1001st" def ordinalize MotionSupport::Inflector.ordinalize(self) end # 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" def ordinal MotionSupport::Inflector.ordinal(self) end end
Version data entries
14 entries across 14 versions & 2 rubygems