mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
Make Set a builtin feature [Feature #16989]
This commit is contained in:
parent
7757ccb504
commit
dd3501bb95
Notes:
git
2022-02-18 11:56:45 +09:00
3 changed files with 49 additions and 1 deletions
|
@ -20,3 +20,12 @@ module Kernel
|
|||
|
||||
private :pp
|
||||
end
|
||||
|
||||
autoload :Set, 'set'
|
||||
|
||||
module Enumerable
|
||||
# Makes a set from the enumerable object with given arguments.
|
||||
def to_set(klass = Set, *args, &block)
|
||||
klass.new(self, *args, &block)
|
||||
end
|
||||
end
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue