Created
September 26, 2017 15:15
-
-
Save Willamin/a819a0e1ff24a7c5b83c7b47fefcbd55 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
my_array = [ | |
:first, | |
:second, | |
:third, | |
:fourth, | |
:fifth | |
] | |
class Int32 | |
def minus_one | |
self - 1 | |
end | |
def st | |
minus_one | |
end | |
def nd | |
minus_one | |
end | |
def rd | |
minus_one | |
end | |
def th | |
minus_one | |
end | |
end | |
puts my_array[1.st] | |
puts my_array[2.nd] | |
puts my_array[4.th] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment