Method: Containers::Stack#push

Defined in:
lib/containers/stack.rb

#push(obj) ⇒ Object Also known as: <<

Adds an item to the stack.

s = Containers::Stack.new([1])
s.push(2)
s.pop #=> 2
s.pop #=> 1


35
36
37
# File 'lib/containers/stack.rb', line 35

def push(obj)
  @container.push_back(obj)
end