Class: Array
- Inherits:
-
Object
- Object
- Array
- Defined in:
- lib/dsl/monkeypatches.rb,
lib/dsl/monkeypatches.rb
Overview
Enchancement of Array
class to generate random array of the given size. The array elements are instances of the samples given. E. g. by default, there is an array of strings and fixnums produced.
Instance Method Summary collapse
-
#∀(size: 64, samples: ["", 1000]) ⇒ Array
(also: #any)
Generates random sample of
Array
.
Instance Method Details
#∀(size: 64, samples: ["", 1000]) ⇒ Array Also known as: any
Generates random sample of Array
.
106 107 108 109 |
# File 'lib/dsl/monkeypatches.rb', line 106 def ∀(size: 64, samples: ["", 1000]) samples = self unless self.empty? [].tap { |v| size.times { v << ::Kernel::random(:samples => samples) } } end |