Issue #12047 has been updated by Gavin Kistner.

Subject changed from Set#=== to Set#=== (aliased to include?)

----------------------------------------
Feature #12047: Set#=== (aliased to include?)
https://bugs.ruby-lang.org/issues/12047#change-56848

* Author: Gavin Kistner
* Status: Open
* Priority: Normal
* Assignee: 
----------------------------------------
Add `Set#===` as an alias for `Set#include?` so that sets may be used in `case` statements:

~~~
require 'set'
GOOD_COMMANDS = Set[ :foo, :bar, :jim ]
BAD_COMMANDS  = Set[ :baz, :bax, :jam ]
ODD_COMMANDS  = Set[ :quux, :xyzzy ]

case my_command
  when GOOD_COMMANDS then puts "Yay!"
  when BAD_COMMANDS  then puts "Boo!"
  when ODD_COMMANDS  then puts "Whaa?"
end
~~~



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>