lib/linked/list.rb
def shift
      return nil if empty?

      if list_head.last?
        @_chain.tap { @_chain = nil }
      else
        old_head = list_head
        @_chain = list_head.next
        old_head.delete
      end
    end
def shift
      return nil if empty?

      if list_head.last?
        @_chain.tap { @_chain = nil }
      else
        old_head = list_head
        @_chain = list_head.next
        old_head.delete
      end
    end
Shift the first item off the list.

 @return [Listable, nil] the first item in the list, or nil if the list is
   empty.