diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer/inflections.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/integer/inflections.rb | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer/inflections.rb b/activesupport/lib/active_support/core_ext/integer/inflections.rb index 94721cfc7c..87b57e3adf 100644 --- a/activesupport/lib/active_support/core_ext/integer/inflections.rb +++ b/activesupport/lib/active_support/core_ext/integer/inflections.rb @@ -1,11 +1,17 @@ -require File.dirname(__FILE__) + '/../../inflector' unless defined? Inflector +require 'active_support/inflector' + module ActiveSupport #:nodoc: module CoreExtensions #:nodoc: module Integer #:nodoc: module Inflections - # 1.ordinalize # => "1st" - # 3.ordinalize # => "3rd" - # 10.ordinalize # => "10th" + # Ordinalize turns a number into an ordinal string used to denote the + # position in an ordered sequence such as 1st, 2nd, 3rd, 4th. + # + # Examples + # 1.ordinalize # => "1st" + # 2.ordinalize # => "2nd" + # 1002.ordinalize # => "1002nd" + # 1003.ordinalize # => "1003rd" def ordinalize Inflector.ordinalize(self) end |