class WebMock::ResponsesSequence

def end?

def end?
  @times_to_repeat == 0
end

def increase_position

def increase_position
  if @current_position == (@responses.length - 1)
    @current_position = 0
    @times_to_repeat -= 1
  else
    @current_position += 1
  end
end

def initialize(responses)

def initialize(responses)
  @times_to_repeat = 1
  @responses = responses
  @current_position = 0
end

def next_response

def next_response
  if @times_to_repeat > 0
    response = @responses[@current_position]
    increase_position
    response
  else
    @responses.last
  end
end