@api private
@api private services
@return [Hash] Returns a hash of default configuration options shared
by all constructed clients.
Registers a new service.
Aws.add_service('SvcName', api: '/path/to/svc.api.json', paginators: '/path/to/svc.paginators.json', waiters: '/path/to/svc.waiters.json', resources: '/path/to/svc.resources.json') Aws::SvcName::Client.new #=> #<Aws::SvcName::Client>
@param [String] svc_name The name of the service. This will also be
the namespace under {Aws}. This must be a valid constant name.
@option options :api @option options :paginators @option options :waiters @option options :resources @return [Module<Service>] Returns the new service module.
# File lib/aws-sdk-core.rb, line 251 def add_service(svc_name, options = {}) svc_module = Module.new { extend Service } const_set(svc_name, svc_module) @services[svc_name] = [svc_module, options] @service_added_callbacks.each do |callback| callback.call(svc_name.to_s, *@services[svc_name]) end svc_module end
@param [Hash] config
# File lib/aws-sdk-core.rb, line 208 def config=(config) if Hash === config @config = config else raise ArgumentError, 'configuration object must be a hash' end end
@api private
# File lib/aws-sdk-core.rb, line 262 def load_all_services SERVICE_MODULE_NAMES.each do |const_name| const_get(const_name) end end
@api private
# File lib/aws-sdk-core.rb, line 229 def load_json(path) Seahorse::Util.load_json(path) end
Yields to the given block for each service that has already been defined via {add_service}. Also yields to the given block for each new service added after the callback is registered. @api private
# File lib/aws-sdk-core.rb, line 220 def service_added(&block) callback = Proc.new @services.each do |svc_name, (svc_module, options)| yield(svc_name, svc_module, options) end @service_added_callbacks << callback end