Issue #12047 has been reported by Gavin Kistner.
----------------------------------------
Feature #12047: Set#===
https://bugs.ruby-lang.org/issues/12047
* 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>