Class: Seahorse::Client::HandlerListEntry

Inherits:
Object
  • Object
show all
Defined in:
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

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>)

26
27
28
29
30
31
32
33
34
# File 'aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 26

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

Instance Attribute Details

#handler_classHandler, Class<Handler> (readonly)


38
39
40
# File 'aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 38

def handler_class
  @handler_class
end

#insertedInteger (readonly)


44
45
46
# File 'aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 44

def inserted
  @inserted
end

#operationsSet<String> (readonly)


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

def operations
  @operations
end

#priorityInteger (readonly)


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

def priority
  @priority
end

#stepSymbol (readonly)


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

def step
  @step
end

#weightInteger (readonly)


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

def weight
  @weight
end

Instance Method Details

#copy(options = {}) ⇒ HandlerListEntry

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>)

69
70
71
# File 'aws-sdk-core/lib/seahorse/client/handler_list_entry.rb', line 69

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