Module: WithRandomizations
- Extended by:
- ActiveSupport::Concern
- Included in:
- Exercise
- Defined in:
- app/models/concerns/with_randomizations.rb
Defined Under Namespace
Modules: ClassMethods
Instance Method Summary collapse
Instance Method Details
#randomizer ⇒ Object
17 18 19 20 |
# File 'app/models/concerns/with_randomizations.rb', line 17 def randomizer #TODO remove this hack after removing seed state from here @randomizer ||= (Mumukit::Randomizer.parse(randomizations) rescue Mumukit::Randomizer.new([])) end |
#seed ⇒ Object
9 10 11 |
# File 'app/models/concerns/with_randomizations.rb', line 9 def seed @seed || 0 end |
#seed_with!(seed) ⇒ Object
13 14 15 |
# File 'app/models/concerns/with_randomizations.rb', line 13 def seed_with!(seed) @seed = seed end |