Class: Seahorse::Client::Plugin
- Inherits:
-
Object
- Object
- Seahorse::Client::Plugin
- Extended by:
- HandlerBuilder
- Defined in:
- lib/seahorse/client/plugin.rb
Direct Known Subclasses
Aws::Plugins::APIGAuthorizerToken, Aws::Plugins::APIGCredentialsConfiguration, Aws::Plugins::APIGUserAgent, Aws::Plugins::ApiKey, Aws::Plugins::ClientMetricsPlugin, Aws::Plugins::ClientMetricsSendPlugin, Aws::Plugins::CredentialsConfiguration, Aws::Plugins::EndpointDiscovery, Aws::Plugins::EndpointPattern, Aws::Plugins::EventStreamConfiguration, Aws::Plugins::GlobalConfiguration, Aws::Plugins::HelpfulSocketErrors, Aws::Plugins::IdempotencyToken, Aws::Plugins::JsonvalueConverter, Aws::Plugins::Logging, Aws::Plugins::ParamConverter, Aws::Plugins::ParamValidator, Aws::Plugins::Protocols::ApiGateway, Aws::Plugins::Protocols::EC2, Aws::Plugins::Protocols::JsonRpc, Aws::Plugins::Protocols::Query, Aws::Plugins::Protocols::RestJson, Aws::Plugins::Protocols::RestXml, Aws::Plugins::RegionalEndpoint, Aws::Plugins::ResponsePaging, Aws::Plugins::RetryErrors, Aws::Plugins::SignatureV2, Aws::Plugins::SignatureV4, Aws::Plugins::StubResponses, Aws::Plugins::UserAgent, Seahorse::Client::Plugins::ContentLength, Seahorse::Client::Plugins::Endpoint, Seahorse::Client::Plugins::Logging, Seahorse::Client::Plugins::NetHttp, Seahorse::Client::Plugins::OperationMethods, Seahorse::Client::Plugins::RaiseResponseErrors, Seahorse::Client::Plugins::ResponseTarget
Defined Under Namespace
Classes: CodeLiteral, PluginOption
Class Method Summary collapse
- .after_initialize(&block) ⇒ Object
- .after_initialize_hooks ⇒ Object private
- .before_initialize(&block) ⇒ Object
- .before_initialize_hooks ⇒ Object private
- .handlers ⇒ Object private
- .literal(string) ⇒ Object private
- .option(name, options = {}, &block) ⇒ void
- .options ⇒ Object private
Instance Method Summary collapse
- #add_handlers(handlers, config) ⇒ void
- #add_options(config) ⇒ void
- #after_initialize(client) ⇒ void
- #before_initialize(client_class, options) ⇒ void
Methods included from HandlerBuilder
handle, handle_request, handle_response, handler_for, new_handler
Class Method Details
.after_initialize(&block) ⇒ Object
69 70 71 |
# File 'lib/seahorse/client/plugin.rb', line 69 def after_initialize(&block) after_initialize_hooks << block end |
.after_initialize_hooks ⇒ 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.
89 90 91 |
# File 'lib/seahorse/client/plugin.rb', line 89 def after_initialize_hooks @after_initialize_hooks ||= [] end |
.before_initialize(&block) ⇒ Object
65 66 67 |
# File 'lib/seahorse/client/plugin.rb', line 65 def before_initialize(&block) before_initialize_hooks << block end |
.before_initialize_hooks ⇒ 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.
84 85 86 |
# File 'lib/seahorse/client/plugin.rb', line 84 def before_initialize_hooks @before_initialize_hooks ||= [] end |
.handlers ⇒ 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.
79 80 81 |
# File 'lib/seahorse/client/plugin.rb', line 79 def handlers @handlers ||= HandlerList.new end |
.literal(string) ⇒ 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.
94 95 96 |
# File 'lib/seahorse/client/plugin.rb', line 94 def literal(string) CodeLiteral.new(string) end |
.option(name, options = {}, &block) ⇒ void
This method returns an undefined value.
52 53 54 55 56 57 58 59 60 61 62 63 |
# File 'lib/seahorse/client/plugin.rb', line 52 def option(name, default = nil, = {}, &block) # For backwards-compat reasons, the default value can be passed as 2nd # positional argument (before the options hash) or as the `:default` option # in the options hash. if Hash === default = default else [:default] = default end [:default_block] = Proc.new if block_given? self. << PluginOption.new(name, ) end |
.options ⇒ 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.
74 75 76 |
# File 'lib/seahorse/client/plugin.rb', line 74 def @options ||= [] end |
Instance Method Details
#add_handlers(handlers, config) ⇒ void
This method returns an undefined value.
22 23 24 |
# File 'lib/seahorse/client/plugin.rb', line 22 def add_handlers(handlers, config) handlers.copy_from(self.class.handlers) end |
#add_options(config) ⇒ void
This method returns an undefined value.
9 10 11 12 13 14 15 16 17 |
# File 'lib/seahorse/client/plugin.rb', line 9 def (config) self.class..each do |option| if option.default_block config.add_option(option.name, &option.default_block) else config.add_option(option.name, option.default) end end end |
#after_initialize(client) ⇒ void
This method returns an undefined value.
37 38 39 40 41 |
# File 'lib/seahorse/client/plugin.rb', line 37 def after_initialize(client) self.class.after_initialize_hooks.each do |block| block.call(client) end end |
#before_initialize(client_class, options) ⇒ void
This method returns an undefined value.
29 30 31 32 33 |
# File 'lib/seahorse/client/plugin.rb', line 29 def before_initialize(client_class, ) self.class.before_initialize_hooks.each do |block| block.call(client_class, ) end end |