Sha256: 6195c49b54a54bbbc8a31eb0a9ea0497554f3d653b2f3b712f077ceca4bb387e
Contents?: true
Size: 272 Bytes
Versions: 10
Compression:
Stored size: 272 Bytes
Contents
module Enumerable if RUBY_VERSION < "1.9" # Return the first n items from the collection # def take(n) res = [] count = 0 each do |e| break if count >= n res << e count += 1 end res end end end
Version data entries
10 entries across 10 versions & 1 rubygems