| 1 | package OpenTracing::Role::ContextReference; | ||||||||||
| 2 | |||||||||||
| 3 | |||||||||||
| 4 | |||||||||||
| 5 | 3 | our $VERSION = '0.08_003'; | |||||||||
| 6 | |||||||||||
| 7 | |||||||||||
| 8 | |||||||||||
| 9 | 3 | ▶ | use Moo::Role; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | 3 | ▶ | use MooX::Enumeration; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 11 | 3 | ▶ | use MooX::ProtectedAttributes; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 12 | |||||||||||
| 13 | 3 | ▶ | use Types::Standard qw/Enum/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 14 | 3 | ▶ | use OpenTracing::Types qw/SpanContext/; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 15 | |||||||||||
| 16 | 3 | ▶ | use constant CHILD_OF => 'child_of'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 17 | 3 | ▶ | use constant FOLLOWS_FROM => 'follows_from'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 18 | |||||||||||
| 19 | |||||||||||
| 20 | |||||||||||
| 21 | 3 | protected_has reference_type => ( | |||||||||
| 22 | is => 'ro', | ||||||||||
| 23 | isa => Enum[ CHILD_OF, FOLLOWS_FROM ], | ||||||||||
| 24 | ); | ||||||||||
| 25 | |||||||||||
| 26 | |||||||||||
| 27 | |||||||||||
| 28 | 3 | has referenced_context => ( | |||||||||
| 29 | is => 'ro', | ||||||||||
| 30 | isa => SpanContext, | ||||||||||
| 31 | required => 1, | ||||||||||
| 32 | reader => 'get_referenced_context', | ||||||||||
| 33 | ); | ||||||||||
| 34 | |||||||||||
| 35 | |||||||||||
| 36 | |||||||||||
| 37 | sub new_child_of { | ||||||||||
| 38 | 1 | ▶ | $_[0]->new( | ||||||||
|
Subroutine
new_child_of: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 39 | reference_type => CHILD_OF, | ||||||||||
| 40 | referenced_context => $_[1], | ||||||||||
| 41 | ) | ||||||||||
| 42 | } | ||||||||||
| 43 | |||||||||||
| 44 | 1 | ▶ | sub type_is_child_of { $_[0]->reference_type eq CHILD_OF } | ||||||||
|
Subroutine
type_is_child_of: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 45 | |||||||||||
| 46 | |||||||||||
| 47 | sub new_follows_from { | ||||||||||
| 48 | 1 | ▶ | $_[0]->new( | ||||||||
|
Subroutine
new_follows_from: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 49 | reference_type => FOLLOWS_FROM, | ||||||||||
| 50 | referenced_context => $_[1], | ||||||||||
| 51 | ) | ||||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 1 | ▶ | sub type_is_follows_from { $_[0]->reference_type eq FOLLOWS_FROM } | ||||||||
|
Subroutine
type_is_follows_from: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 55 | |||||||||||
| 56 | |||||||||||
| 57 | BEGIN { | ||||||||||
| 58 | with 'OpenTracing::Interface::ContextReference' | ||||||||||
| 59 | 3 | ▶ | if $ENV{OPENTRACING_INTERFACE}; | ||||||||
|
Subroutine
BEGIN: called CC=2 SCAR=6.9
Branch: 1 branch
| |||||||||||
| 60 | } | ||||||||||
| 61 | |||||||||||
| 62 | |||||||||||
| 63 | 3 | 1; | |||||||||