Sha256: d91e418b445c0daa23c58957b0599b7b7a1ef2e9d3de98f8057cd7090fac515e

Contents?: true

Size: 477 Bytes

Versions: 269

Compression:

Stored size: 477 Bytes

Contents

require 'active_support/inflector'

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
    ActiveSupport::Inflector.ordinalize(self)
  end
end

Version data entries

269 entries across 225 versions & 25 rubygems

Version Path
activesupport-3.2.10 lib/active_support/core_ext/integer/inflections.rb
activesupport-3.1.9 lib/active_support/core_ext/integer/inflections.rb
classiccms-0.6.9 vendor/bundle/gems/activesupport-3.2.3/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.2/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.3 vendor/bundle/gems/jquery_regex-0.0.3/vendor/bundle/gems/jquery_regex-0.0.1/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
jquery_regex-0.0.1 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
dirty_history-0.7.3 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/integer/inflections.rb
dirty_history-0.7.2 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/integer/inflections.rb
dirty_history-0.7.1 dirty_history/ruby/1.9.1/gems/activesupport-3.1.1/lib/active_support/core_ext/integer/inflections.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/activesupport-3.2.7/lib/active_support/core_ext/integer/inflections.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.7/lib/active_support/core_ext/integer/inflections.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/activesupport-3.2.9/lib/active_support/core_ext/integer/inflections.rb
challah-rolls-0.2.0 vendor/bundle/gems/activesupport-3.2.8/lib/active_support/core_ext/integer/inflections.rb