Class: AnswerFactory::Machines::BuildRandom
- Defined in:
- lib/machines/build_random.rb
Instance Attribute Summary
Attributes inherited from Machine
Instance Method Summary collapse
- #build(batch = nil, overridden_options = {}) ⇒ Object (also: #generate)
Methods inherited from Machine
Constructor Details
This class inherits a constructor from AnswerFactory::Machines::Machine
Instance Method Details
#build(batch = nil, overridden_options = {}) ⇒ Object Also known as: generate
10 11 12 13 14 15 16 |
# File 'lib/machines/build_random.rb', line 10 def build(batch = nil, = {}) = @options.merge() how_many = [:how_many] || 1 result = Batch.new how_many.times {result << Answer.new(NudgeProgram.random())} return result end |