Parent

Class/Module Index [+]

Quicksearch

WebMock::ResponsesSequence

Attributes

times_to_repeat[RW]

Public Class Methods

new(responses) click to toggle source
# File lib/webmock/responses_sequence.rb, line 7
def initialize(responses)
  @times_to_repeat = 1
  @responses = responses
  @current_position = 0
end

Public Instance Methods

end?() click to toggle source
# File lib/webmock/responses_sequence.rb, line 13
def end?
  @times_to_repeat == 0
end
next_response() click to toggle source
# File lib/webmock/responses_sequence.rb, line 17
def next_response
  if @times_to_repeat > 0
    response = @responses[@current_position]
    increase_position
    response
  else
    @responses.last
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.