Sha256: 71edc6cb4475fbe85eb0af92f7ebc50a49d18c2dbd26493a0b2ea67923f9e50f
Contents?: true
Size: 311 Bytes
Versions: 47
Compression:
Stored size: 311 Bytes
Contents
unless Enumerable.method_defined? :drop require 'backports/tools/arguments' module Enumerable def drop(n) n = Backports.coerce_to_int(n) raise ArgumentError, "attempt to drop negative size" if n < 0 ary = to_a return [] if n > ary.size ary[n...ary.size] end end end
Version data entries
47 entries across 47 versions & 4 rubygems