method

second_to_last

v5.2.3 - Show latest stable - Class: Array
second_to_last()
public

Equal to self[-2].

%w( a b c d e ).second_to_last # => "d"