Class: Set

Inherits:
Object show all
Defined in:
lib/ext_core.rb

Overview

Some extentions to the core Set class

Class Method Summary collapse

Instance Method Summary collapse

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