Class: Ruboty::Slot::SlotMachine
- Inherits:
-
Object
- Object
- Ruboty::Slot::SlotMachine
- Defined in:
- lib/ruboty/slot/slot_machine.rb
Direct Known Subclasses
Instance Method Summary collapse
Instance Method Details
#pull_lever ⇒ Object
10 11 12 |
# File 'lib/ruboty/slot/slot_machine.rb', line 10 def pull_lever reels.each(&:roll) end |
#push_stop_button(n) ⇒ Object
14 15 16 |
# File 'lib/ruboty/slot/slot_machine.rb', line 14 def (n) reels[n].stop end |
#reels ⇒ Object
6 7 8 |
# File 'lib/ruboty/slot/slot_machine.rb', line 6 def reels [] end |
#to_s ⇒ Object
18 19 20 21 |
# File 'lib/ruboty/slot/slot_machine.rb', line 18 def to_s first, *rest = reels.map(&:to_a) first.zip(*rest).map(&:join).join($/) end |