Sha256: b39d09767bbbfeb3e40d7f4eb3695c7792d1b3d411a8c63829f13f2554fdc742
Contents?: true
Size: 470 Bytes
Versions: 9
Compression:
Stored size: 470 Bytes
Contents
module Polyfill module V2_4 module Enumerator module Lazy using Polyfill(Enumerable: %w[#chunk_while], version: '2.4') def chunk_while super.lazy end def uniq seen = Set.new ::Enumerator::Lazy.new(self) do |yielder, *values| result = block_given? ? yield(*values) : values yielder.<<(*values) if seen.add?(result) end end end end end end
Version data entries
9 entries across 9 versions & 1 rubygems