Массивы и коллекции

intStack = []
intStack.push(1)
intStack.push(3)
intStack.push(5)

top = intStack[-1]
# top is 5
first = intStack.pop()
# first is 5
second = intStack.pop()
# second is 3
third = intStack.pop()
# third is 1

puts "top is #{top}"
puts "first is #{first}"
puts "second is #{second}"
puts "third is #{third}"