Class: RandomDistribution::Sequence::RubyGlobalGenerator

Inherits:
Object
  • Object
show all
Defined in:
lib/redshift/util/random.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(seed = nil) ⇒ RubyGlobalGenerator

Returns a new instance of RubyGlobalGenerator.



12
13
14
15
# File 'lib/redshift/util/random.rb', line 12

def initialize(seed = nil)
  @seed = seed
  srand(seed) if seed
end

Instance Attribute Details

#seedObject (readonly)

Returns the value of attribute seed.



10
11
12
# File 'lib/redshift/util/random.rb', line 10

def seed
  @seed
end

Instance Method Details

#nextObject



16
17
18
# File 'lib/redshift/util/random.rb', line 16

def next
  rand
end