Class: Seahorse::Client::Plugins::Endpoint

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

Defined Under Namespace

Classes: Handler

Instance Method Summary collapse

Methods inherited from Seahorse::Client::Plugin

#add_handlers, #add_options, after_initialize, #before_initialize, before_initialize, option

Methods included from HandlerBuilder

#handle, #handle_request, #handle_response

Instance Method Details

#after_initialize(client) ⇒ Object


21
22
23
24
25
26
27
28
29
# File 'aws-sdk-core/lib/seahorse/client/plugins/endpoint.rb', line 21

def after_initialize(client)
  endpoint = URI.parse(client.config.endpoint.to_s)
  if URI::HTTPS === endpoint or URI::HTTP === endpoint
    client.config.endpoint = endpoint
  else
    msg = 'expected :endpoint to be a HTTP or HTTPS endpoint'
    raise ArgumentError, msg
  end
end