Skip to content

Instantly share code, notes, and snippets.

@ivanbrennan
Created September 30, 2013 22:26
Show Gist options
  • Select an option

  • Save ivanbrennan/6771221 to your computer and use it in GitHub Desktop.

Select an option

Save ivanbrennan/6771221 to your computer and use it in GitHub Desktop.
Deli Counter
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