Method: TTY::Reader::History#next

Defined in:
lib/tty/reader/history.rb

#nextObject

Move the pointer to the next line in the history

API:

  • public



109
110
111
112
113
114
115
116
117
# File 'lib/tty/reader/history.rb', line 109

def next
  return if size.zero?

  if @index == size - 1
    @index = 0 if @cycle
  else
    @index += 1
  end
end