summaryrefslogtreecommitdiff
path: root/lib/stack.rb
blob: a2b8c04ca907d8047de34fbdaa84970b35e17230 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
class Stack
  def initialize
    @items = []
  end
  def push(item)
    @items << item
  end
  def pop
    @items.delete_at(-1)
  end
  def total_items
    @items.length
  end
end