Class: Seahorse::Client::HandlerListEntry

Inherits:
Object
  • Object
show all
Defined in:
gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb

Overview

A container for an un-constructed handler. A handler entry has the handler class, and information about handler priority/order.

This class is an implementation detail of the HandlerList class. Do not rely on public interfaces of this class.

Constant Summary collapse

STEPS =
{
  initialize: 400,
  validate: 300,
  build: 200,
  sign: 100,
  send: 0,
}

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(options) ⇒ HandlerListEntry

Returns a new instance of HandlerListEntry.

Parameters:

  • options (Hash)

    a customizable set of options

Options Hash (options):

  • :handler_class (required, Class<Handler>)
  • :inserted (required, Integer)

    The insertion order/position. This is used to determine sort order when two entries have the same priority.

  • :step (Symbol) — default: :build
  • :priority (Integer) — default: 50
  • :operations (Set<String>)


28
29
30
31
32
33
34
35
36
37
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 28

def initialize(options)
  @options = options
  @handler_class = option(:handler_class, options)
  @inserted = option(:inserted, options)
  @operations = options[:operations]
  @operations = Set.new(options[:operations]).map(&:to_s) if @operations
  set_step(options[:step] || :build)
  set_priority(options[:priority] || 50)
  compute_weight
end

Instance Attribute Details

#handler_classHandler, Class<Handler> (readonly)

Returns the handler. This may be a constructed handler object or a handler class.

Returns:

  • (Handler, Class<Handler>)

    Returns the handler. This may be a constructed handler object or a handler class.



41
42
43
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 41

def handler_class
  @handler_class
end

#insertedInteger (readonly)

Returns The insertion order/position. This is used to determine sort order when two entries have the same priority. Entries inserted later (with a higher inserted value) have a lower priority.

Returns:

  • (Integer)

    The insertion order/position. This is used to determine sort order when two entries have the same priority. Entries inserted later (with a higher inserted value) have a lower priority.



47
48
49
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 47

def inserted
  @inserted
end

#operationsSet<String> (readonly)

Returns:

  • (Set<String>)


56
57
58
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 56

def operations
  @operations
end

#priorityInteger (readonly)

Returns:

  • (Integer)


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

def priority
  @priority
end

#stepSymbol (readonly)

Returns:

  • (Symbol)


50
51
52
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 50

def step
  @step
end

#weightInteger (readonly)

Returns:

  • (Integer)


59
60
61
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 59

def weight
  @weight
end

Instance Method Details

#copy(options = {}) ⇒ HandlerListEntry

Parameters:

  • options (Hash) (defaults to: {})

    a customizable set of options

Options Hash (options):

  • :handler_class (required, Class<Handler>)
  • :inserted (required, Integer)

    The insertion order/position. This is used to determine sort order when two entries have the same priority.

  • :step (Symbol) — default: :build
  • :priority (Integer) — default: 50
  • :operations (Set<String>)

Returns:



72
73
74
# File 'gems/aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 72

def copy(options = {})
  HandlerListEntry.new(@options.merge(options))
end