Sha256: 86ff76aa92fac62c5134bb350528729d2ddb3ddcd3e8f7bef5f8fc140b2e49dc
Contents?: true
Size: 554 Bytes
Versions: 25
Compression:
Stored size: 554 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
25 entries across 25 versions & 1 rubygems