Method: Aws::ClientStubs#next_stub

Defined in:
lib/aws-sdk-core/client_stubs.rb

#next_stub(context) ⇒ Object

This method is part of a private API. You should avoid using this method if possible, as it may be removed or be changed in the future.



219
220
221
222
223
224
225
226
227
228
229
230
231
232
# File 'lib/aws-sdk-core/client_stubs.rb', line 219

def next_stub(context)
  operation_name = context.operation_name.to_sym
  stub = @config.stubs_mutex.synchronize do
    stubs = @config.stubs[operation_name] || []
    case stubs.length
    when 0 then stub_data(operation_name)
    when 1 then stubs.first
    else stubs.shift
    end
  end
  stub = convert_stub(operation_name, stub, context)
  stub[:mutex] = Mutex.new
  stub
end