lib/ruby_algorithms/containers/stack.rb
def pop
    unless @top.nil?
      @top = @top.next
      @top.data if @top
    end
  end
# Pop nodes off the stack by overriding @top with @top.next. Finally, return the
# data that was popped off the stack.
Pop nodes off the stack by overriding @top with @top.next. Finally, return the
data that was popped off the stack.
Pop nodes off the stack by overriding @top with @top . next . Finally return the data that was popped off the stack .
def pop
    unless @top.nil?
      @top = @top.next
      @top.data if @top
    end
  end
def pop unless @top . nil? @top = @top . next @top . data if @top end end
Pop nodes off the stack by overriding @top with @top.next.
Pop nodes off the stack by overriding @top with @top . next .