class Array # Change the last element. # # require 'facet/array/last' # # a = [1,2,5] # a.last = 3 # p a #=> [1,2,3] # def last=(x) self[-1] = x end end