ruby-changes:66965
From: Jeremy <ko1@a...>
Date: Thu, 29 Jul 2021 14:50:33 +0900 (JST)
Subject: [ruby-changes:66965] 52e602edda (master): [ruby/set] Update documentation for intersect?/disjoint?
https://git.ruby-lang.org/ruby.git/commit/?id=52e602edda From 52e602edda0aa61a83f558bcf9bfdd97a4fd107f Mon Sep 17 00:00:00 2001 From: Jeremy Evans <code@j...> Date: Fri, 18 Jun 2021 08:24:45 -0700 Subject: [ruby/set] Update documentation for intersect?/disjoint? https://github.com/ruby/set/commit/35b69e9d69 --- lib/set.rb | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/lib/set.rb b/lib/set.rb index 8ed6e80..0179b52 100644 --- a/lib/set.rb +++ b/lib/set.rb @@ -468,11 +468,13 @@ class Set https://github.com/ruby/ruby/blob/trunk/lib/set.rb#L468 end end - # Returns true if the set and the given set have at least one + # Returns true if the set and the given enumerable have at least one # element in common. # # Set[1, 2, 3].intersect? Set[4, 5] #=> false # Set[1, 2, 3].intersect? Set[3, 4] #=> true + # Set[1, 2, 3].intersect? 4..5 #=> false + # Set[1, 2, 3].intersect? [3, 4] #=> true def intersect?(set) case set when Set @@ -488,11 +490,13 @@ class Set https://github.com/ruby/ruby/blob/trunk/lib/set.rb#L490 end end - # Returns true if the set and the given set have no element in - # common. This method is the opposite of `intersect?`. + # Returns true if the set and the given enumerable have + # no element in common. This method is the opposite of `intersect?`. # # Set[1, 2, 3].disjoint? Set[3, 4] #=> false # Set[1, 2, 3].disjoint? Set[4, 5] #=> true + # Set[1, 2, 3].disjoint? [3, 4] #=> false + # Set[1, 2, 3].disjoint? 4..5 #=> true def disjoint?(set) !intersect?(set) end -- cgit v1.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/