From e8aeda2ab39b5d416a72edfa74e0fb17721eb6f9 Mon Sep 17 00:00:00 2001 From: Brian Christian Date: Wed, 10 Feb 2016 10:10:38 -0800 Subject: rename to 'second_to_last' and 'third_to_last' --- activesupport/lib/active_support/core_ext/array/access.rb | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'activesupport/lib/active_support') diff --git a/activesupport/lib/active_support/core_ext/array/access.rb b/activesupport/lib/active_support/core_ext/array/access.rb index e413acddc5..37d833887a 100644 --- a/activesupport/lib/active_support/core_ext/array/access.rb +++ b/activesupport/lib/active_support/core_ext/array/access.rb @@ -76,15 +76,15 @@ class Array # Equal to self[-3]. # - # %w( a b c d e ).antepenultimate # => "c" - def antepenultimate + # %w( a b c d e ).third_to_last # => "c" + def third_to_last self[-3] end # Equal to self[-2]. # - # %w( a b c d e ).penultimate # => "d" - def penultimate + # %w( a b c d e ).second_to_last # => "d" + def second_to_last self[-2] end end -- cgit v1.2.3