Class: Aws::Plugins::StubResponses

Inherits:
Seahorse::Client::Plugin show all
Defined in:
lib/aws-sdk-core/plugins/stub_responses.rb

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_options, after_initialize, after_initialize_hooks, before_initialize, #before_initialize, before_initialize_hooks, handlers, option, options

Methods included from Seahorse::Client::HandlerBuilder

#handle, #handle_request, #handle_response, #handler_for, #new_handler

Instance Method Details

#add_handlers(handlers, config) ⇒ Object


27
28
29
# File 'lib/aws-sdk-core/plugins/stub_responses.rb', line 27

def add_handlers(handlers, config)
  handlers.add(Handler, step: :send) if config.stub_responses
end

#after_initialize(client) ⇒ Object


31
32
33
34
35
36
# File 'lib/aws-sdk-core/plugins/stub_responses.rb', line 31

def after_initialize(client)
  if client.config.stub_responses
    client.setup_stubbing
    client.handlers.remove(RetryErrors::Handler)
  end
end