Module: RandomSet
- Defined in:
- lib/random_set.rb,
lib/random_set/version.rb,
lib/random_set/gaussian.rb,
lib/random_set/template.rb,
lib/random_set/gaussian_trend.rb
Defined Under Namespace
Classes: CannotInferCount, Gaussian, GaussianTrend, Template, UnsupportedTemplate
Constant Summary collapse
- VERSION =
"0.0.2"
Class Method Summary collapse
-
.generate([count], template) ⇒ Array
Generates a series of data based on the given template.
Class Method Details
.generate([count], template) ⇒ Array
Generates a series of data based on the given template. This template may be a hash or an array. If a hash is given, the output of this function is an array of hashes. Conversely, if an array is given, the output is an array of arrays.
20 21 22 23 24 |
# File 'lib/random_set.rb', line 20 def generate(*args) raise ArgumentError, "template required" if args.empty? raise ArgumentError, "too many arguments (1..2 expected)" if args.length > 2 Template.new(args.pop).generate *args end |