Module: RV::RV_Generator
- Included in:
- Binomial, BoxMuller, Exponential, Gamma, Geometric, Normal, 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 iterable.
Instance Method Summary collapse
Instance Method Details
#each ⇒ Object
28 29 30 |
# File 'lib/random_variates.rb', line 28 def each Enumerator.new { |y| loop { y << self.next } } end |
#next ⇒ Object
24 25 26 |
# File 'lib/random_variates.rb', line 24 def next raise 'next not implemented!' end |