Method: Net::SSH::Test::Script#next

Defined in:
lib/net/ssh/test/script.rb

#next(mode = :shift) ⇒ Object

By default, removes the next event in the list and returns it. However, this can also be used to non-destructively peek at the next event in the list, by passing :first as the argument.

# remove the next event and return it
event = script.next

# peek at the next event
event = script.next(:first)


166
167
168
# File 'lib/net/ssh/test/script.rb', line 166

def next(mode = :shift)
  events.send(mode)
end