diff options
Diffstat (limited to 'activesupport/lib/active_support/core_ext/fixnum/inflections.rb')
-rw-r--r-- | activesupport/lib/active_support/core_ext/fixnum/inflections.rb | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/activesupport/lib/active_support/core_ext/fixnum/inflections.rb b/activesupport/lib/active_support/core_ext/fixnum/inflections.rb new file mode 100644 index 0000000000..13c4f1130a --- /dev/null +++ b/activesupport/lib/active_support/core_ext/fixnum/inflections.rb @@ -0,0 +1,15 @@ +require File.dirname(__FILE__) + '/../../inflector' +module ActiveSupport #:nodoc: + module CoreExtensions #:nodoc: + module Fixnum #:nodoc: + module Inflections + # 1.ordinalize # => "1st" + # 3.ordinalize # => "3rd" + # 10.ordinalize # => "10th" + def ordinalize + Inflector.ordinalize(self) + end + end + end + end +end |