Created
September 30, 2013 22:26
-
-
Save ivanbrennan/6771221 to your computer and use it in GitHub Desktop.
Deli Counter
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def take_a_number(deli, person) | |
| deli << person | |
| deli.length | |
| end | |
| def now_serving(deli) | |
| puts "Currently serving #{deli.first}" | |
| deli.shift | |
| end | |
| def line(deli) | |
| print "The line is currently:" | |
| deli.each_with_index {|person, i| print " #{i+1}. #{person}"} | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment