sonic-pi

https://github.com/sonic-pi-net/sonic-pi

C++

Code. Music. Live.

Integer#ordinal

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"

Source | Google | Stack overflow

Edit

git clone [email protected]:sonic-pi-net/sonic-pi.git

cd sonic-pi

open app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/integer/inflections.rb

Contribute

# Make a new branch

git checkout -b -your-name--update-docs-Integer-ordinal-for-pr


# Commit to git

git add app/server/ruby/vendor/activesupport-7.0.6/lib/active_support/core_ext/integer/inflections.rbgit commit -m "better docs for Integer#ordinal"


# Open pull request

gem install hub # on a mac you can `brew install hub`

hub fork

git push <your name> -your-name--update-docs-Integer-ordinal-for-pr

hub pull-request


# Celebrate!