Sha256: ebeaf95a64719941b825bfd47bf6c63582ecdbfc248eabd963060976eb991b6b
Contents?: true
Size: 384 Bytes
Versions: 24
Compression:
Stored size: 384 Bytes
Contents
unless Array.method_defined? :butlast class Array # Returns a new array that has all the elements of the current but the last. # # @return [Array] a new array without the last element or an empty array if this # array is empty # # @example # [1, 2, 3].butlast #=> [1, 2] # [].butlast #=> [] def butlast self[0...-1] end end end
Version data entries
24 entries across 21 versions & 6 rubygems