Add Array#fourth to resolve cask errors

This commit is contained in:
Douglas Eichelberger 2024-01-11 14:37:09 -08:00
parent c02520f604
commit 79e2379d98
2 changed files with 8 additions and 0 deletions

View File

@ -12,6 +12,11 @@ class Array
# %w( a b c d e ).third # => "c" # %w( a b c d e ).third # => "c"
def third = self[2] def third = self[2]
# Equal to <tt>self[3]</tt>.
#
# %w( a b c d e ).fourth # => "d"
def fourth = self[3]
# Converts the array to a comma-separated sentence where the last element is # Converts the array to a comma-separated sentence where the last element is
# joined by the connector word. # joined by the connector word.
# #

View File

@ -6,4 +6,7 @@ class Array
sig { returns(T.nilable(Elem)) } sig { returns(T.nilable(Elem)) }
def third; end def third; end
sig { returns(T.nilable(Elem)) }
def fourth; end
end end