Class: Mumukit::Randomizer::Randomization::Base
- Inherits:
-
Object
- Object
- Mumukit::Randomizer::Randomization::Base
- Defined in:
- lib/mumukit/randomizations/base.rb
Instance Attribute Summary collapse
-
#choices ⇒ Object
Returns the value of attribute choices.
Instance Method Summary collapse
Instance Attribute Details
#choices ⇒ Object
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 |
#size ⇒ Object
4 5 6 |
# File 'lib/mumukit/randomizations/base.rb', line 4 def size choices.size end |