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

#eachObject



30
31
32
33
34
35
36
# File 'lib/random_variates.rb', line 30

def each
  Enumerator.new do |y|
    while true
      y << self.next
    end
  end
end

#nextObject



26
27
28
# File 'lib/random_variates.rb', line 26

def next
  raise 'next not implemented!'
end