diff options
author | Brian Christian <brchristian@gmail.com> | 2016-02-10 10:10:38 -0800 |
---|---|---|
committer | Brian Christian <brchristian@gmail.com> | 2016-02-10 10:10:38 -0800 |
commit | e8aeda2ab39b5d416a72edfa74e0fb17721eb6f9 (patch) | |
tree | ea2b76a40f9d9ce3046a9fae3f177b9e4c0b1706 /activesupport/lib | |
parent | c74045cf0771ab51dfeca94b30c447cab6193e60 (diff) | |
download | rails-e8aeda2ab39b5d416a72edfa74e0fb17721eb6f9.tar.gz rails-e8aeda2ab39b5d416a72edfa74e0fb17721eb6f9.tar.bz2 rails-e8aeda2ab39b5d416a72edfa74e0fb17721eb6f9.zip |
rename to 'second_to_last' and 'third_to_last'
Diffstat (limited to 'activesupport/lib')
-rw-r--r-- | activesupport/lib/active_support/core_ext/array/access.rb | 8 |
1 files changed, 4 insertions, 4 deletions
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 <tt>self[-3]</tt>. # - # %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 <tt>self[-2]</tt>. # - # %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 |