aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport/lib/active_support/core_ext/integer/inflections.rb
diff options
context:
space:
mode:
Diffstat (limited to 'activesupport/lib/active_support/core_ext/integer/inflections.rb')
-rw-r--r--activesupport/lib/active_support/core_ext/integer/inflections.rb26
1 files changed, 10 insertions, 16 deletions
diff --git a/activesupport/lib/active_support/core_ext/integer/inflections.rb b/activesupport/lib/active_support/core_ext/integer/inflections.rb
index 804702beb2..e81e7af436 100644
--- a/activesupport/lib/active_support/core_ext/integer/inflections.rb
+++ b/activesupport/lib/active_support/core_ext/integer/inflections.rb
@@ -1,20 +1,14 @@
require 'active_support/inflector'
-module ActiveSupport #:nodoc:
- module CoreExtensions #:nodoc:
- module Integer #:nodoc:
- module Inflections
- # 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"
- def ordinalize
- Inflector.ordinalize(self)
- end
- end
- end
+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"
+ def ordinalize
+ ActiveSupport::Inflector.ordinalize(self)
end
end