Class: HTTPX::Plugins::Tracing::Wrapper

Inherits:
Object
  • Object
show all
Includes:
_Tracer
Defined in:
lib/httpx/plugins/tracing.rb,
sig/plugins/tracing.rbs

Instance Attribute Summary collapse

Instance Method Summary collapse

Methods included from _Tracer

#enabled?, #finish, #reset, #start

Constructor Details

#initialize(*tracers) ⇒ Wrapper

Returns a new instance of Wrapper.

Parameters:



16
17
18
19
20
21
22
23
24
25
# File 'lib/httpx/plugins/tracing.rb', line 16

def initialize(*tracers)
  @tracers = tracers.flat_map do |tracer|
    case tracer
    when Wrapper
      tracer.tracers
    else
      tracer
    end
  end.uniq
end

Instance Attribute Details

#tracersArray[_Tracer] (readonly)

Returns the value of attribute tracers.

Returns:



13
14
15
# File 'lib/httpx/plugins/tracing.rb', line 13

def tracers
  @tracers
end

Instance Method Details

#freezeObject



31
32
33
34
# File 'lib/httpx/plugins/tracing.rb', line 31

def freeze
  @tracers.each(&:freeze).freeze
  super
end

#merge(tracer) ⇒ void

This method returns an undefined value.

Parameters:

  • (instance)


27
28
29
# File 'lib/httpx/plugins/tracing.rb', line 27

def merge(tracer)
  Wrapper.new(*@tracers, *tracer.tracers)
end