Sha256: 5045b836347ea6d195d14def91a08bb89ad718fabcacb3fb5ff8022e14e7e90e
Contents?: true
Size: 590 Bytes
Versions: 14
Compression:
Stored size: 590 Bytes
Contents
# frozen_string_literal: true RubyNext::Core.patch Array, method: :union, version: "2.6" do <<~RUBY def union(*others) others.reduce(Array.new(self).uniq) { |acc, arr| acc | arr } end RUBY end RubyNext::Core.patch Array, method: :difference, version: "2.6" do <<~RUBY def difference(*others) others.reduce(Array.new(self)) { |acc, arr| acc - arr } end RUBY end RubyNext::Core.patch Array, method: :intersection, version: "2.7" do <<~RUBY def intersection(*others) others.reduce(Array.new(self)) { |acc, arr| acc & arr } end RUBY end
Version data entries
14 entries across 14 versions & 2 rubygems