[ruby] How to get the last element of an array in Ruby?