Class: Set
Overview
Some extentions to the core Set class
Class Method Summary collapse
-
.generate(*args) ⇒ Object
Randomly generate a Set.
Instance Method Summary collapse
-
#generate(*_args) ⇒ Object
Randomly select an element of the Set.
Class Method Details
.generate(*args) ⇒ Object
Randomly generate a Set
129 130 131 |
# File 'lib/ext_core.rb', line 129 def self.generate(*args) new(Array.generate(*args)) end |
Instance Method Details
#generate(*_args) ⇒ Object
Randomly select an element of the Set
134 135 136 |
# File 'lib/ext_core.rb', line 134 def generate(*_args) to_a.sample end |