You are viewing documentation for version 2 of the AWS SDK for Ruby. Version 3 documentation can be found here.

Class: Seahorse::Client::Plugin

Inherits:
Object
  • Object
show all
Extended by:
HandlerBuilder
Defined in:
aws-sdk-core/lib/seahorse/client/plugin.rb

Class Method Summary collapse

Instance Method Summary collapse

Methods included from HandlerBuilder

handle, handle_request, handle_response

Class Method Details

.after_initialize(&block) ⇒ Object



53
54
55
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 53

def after_initialize(&block)
  after_initialize_hooks << block
end

.before_initialize(&block) ⇒ Object



49
50
51
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 49

def before_initialize(&block)
  before_initialize_hooks << block
end

.option(name, default = nil, &block) ⇒ Object



41
42
43
44
45
46
47
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 41

def option(name, default = nil, &block)
  if block_given?
    options << [[name], Proc.new]
  else
    options << [[name, default]]
  end
end

Instance Method Details

#add_handlers(handlers, config) ⇒ void

This method returns an undefined value.

Parameters:



18
19
20
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 18

def add_handlers(handlers, config)
  handlers.copy_from(self.class.handlers)
end

#add_options(config) ⇒ void

This method returns an undefined value.

Parameters:



9
10
11
12
13
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 9

def add_options(config)
  self.class.options.each do |args, block|
    config.add_option(*args, &block)
  end
end

#after_initialize(client) ⇒ void

This method returns an undefined value.

Parameters:



33
34
35
36
37
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 33

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.

Parameters:



25
26
27
28
29
# File 'aws-sdk-core/lib/seahorse/client/plugin.rb', line 25

def before_initialize(client_class, options)
  self.class.before_initialize_hooks.each do |block|
    block.call(client_class, options)
  end
end