Module: RV_Generator
- Includes:
- Enumerable
- Included in:
- Binomial, BoxMuller, Exponential, Gamma, Gaussian, Geometric, Poisson, Triangle, Uniform, VonMises, Weibull
- Defined in:
- lib/random_variates.rb
Overview
The RV_Generator module provides a common core of methods to make all of the RV classes Enumerable.
Instance Attribute Summary collapse
-
#generator ⇒ Object
readonly
Returns the value of attribute generator.
Instance Method Summary collapse
Instance Attribute Details
#generator ⇒ Object (readonly)
Returns the value of attribute generator.
25 26 27 |
# File 'lib/random_variates.rb', line 25 def generator @generator end |
Instance Method Details
#each ⇒ Object
31 32 33 |
# File 'lib/random_variates.rb', line 31 def each loop { yield @generator.next } end |
#next ⇒ Object
27 28 29 |
# File 'lib/random_variates.rb', line 27 def next @generator.next end |