I know that Rails has sorting methods built into ActiveRecord, but I'm just writing a simple ruby โโscript and would like to sort the entries from the array by date.
The date will be stored in one of the cells of the multidimensional array.
What is the best way for me to approach this, so I can get to the point where I just do sort_by_date
and I specify either ASC
or DESC
?
I do not need to use the sort_by_date
method, but the idea is that I would like to easily call the method in the collection and get the results that I want.
Thoughts?
source share