lib/dead_end/clean_document.rb
def take_while_including(range = 0..-1)
      take_next_and_stop = false
      @document[range].take_while do |line|
        next if take_next_and_stop

        take_next_and_stop = !(yield line)
        true
      end
    end
# Helper method for grabbing elements from document
#
# Like `take_while` except when it stops
# iterating, it also returns the line
# that caused it to stop
Helper method for grabbing elements from document
Like `take_while` except when it stops
iterating, it also returns the line
that caused it to stop
Helper method for grabbing elements from document Like ` take_while ` except when it stops iterating it also returns the line that caused it to stop
def take_while_including(range = 0..-1)
      take_next_and_stop = false
      @document[range].take_while do |line|
        next if take_next_and_stop
        take_next_and_stop = !(yield line)
        true
      end
    end
def take_while_including ( range = 0 .. - 1 ) take_next_and_stop = false @document [ range ] . take_while do | line | next if take_next_and_stop take_next_and_stop = ! ( yield line ) true end end
Helper method for grabbing elements from document
Like `take_while` except when it stops
iterating, it also returns the line
that caused it to stop
Helper method for grabbing elements from document Like ` take_while ` except when it stops iterating it also returns the line that caused it to stop
range