TIL, 2017-05-12
- You need to require
tzinfo
to be able to useDateTime
. sort_by
then block. No need to do comparable all the time hehe.
def arrangement_for(thing)
order = [ 'haha', 'hoho', 'gaga']
order.index(thing)
end
tzinfo
to be able to use DateTime
.sort_by
then block. No need to do comparable all the time hehe.def arrangement_for(thing)
order = [ 'haha', 'hoho', 'gaga']
order.index(thing)
end