Class: Mumukit::Randomizer::Randomization::Base

Inherits:
Object
  • Object
show all
Defined in:
lib/mumukit/randomizations/base.rb

Direct Known Subclasses

OneOf, Range

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#choicesObject

Returns the value of attribute choices.



2
3
4
# File 'lib/mumukit/randomizations/base.rb', line 2

def choices
  @choices
end

Instance Method Details

#modulo(value, range) ⇒ Object



8
9
10
# File 'lib/mumukit/randomizations/base.rb', line 8

def modulo(value, range)
  Random.new(value).rand(range)
end

#sizeObject



4
5
6
# File 'lib/mumukit/randomizations/base.rb', line 4

def size
  choices.size
end