Class: AnswerFactory::Machines::RemoveAnyOne
- Defined in:
- lib/machines/any_one.rb
Instance Attribute Summary
Attributes inherited from Machine
Instance Method Summary collapse
- #screen(batch) ⇒ Object (also: #generate)
Methods inherited from Machine
Constructor Details
This class inherits a constructor from AnswerFactory::Machines::Machine
Instance Method Details
#screen(batch) ⇒ Object Also known as: generate
24 25 26 27 28 29 30 31 |
# File 'lib/machines/any_one.rb', line 24 def screen(batch) raise ArgumentError, "RemoveAnyOne#screen: argument is not a Batch" unless batch.kind_of?(Batch) working_copy = batch.dup where = rand(working_copy.length) working_copy.delete_at(where) return working_copy end |