| 1 | package Thrift::IDL::Definition; | ||||||||||||
| 2 | |||||||||||||
| 3 | =head1 NAME | ||||||||||||
| 4 | |||||||||||||
| 5 | Thrift::IDL::Definition | ||||||||||||
| 6 | |||||||||||||
| 7 | =head1 DESCRIPTION | ||||||||||||
| 8 | |||||||||||||
| 9 | Inherits from L<Thrift::IDL::Base> | ||||||||||||
| 10 | |||||||||||||
| 11 | =cut | ||||||||||||
| 12 | |||||||||||||
| 13 | 4 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 14 | 4 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 15 | 4 | ▶ | use base qw(Thrift::IDL::Base); | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 16 | |||||||||||||
| 17 | =head1 METHODS | ||||||||||||
| 18 | |||||||||||||
| 19 | =head2 full_name | ||||||||||||
| 20 | |||||||||||||
| 21 | =cut | ||||||||||||
| 22 | |||||||||||||
| 23 | 0 | ▶ | sub full_name { | ||||||||||
|
Subroutine
full_name: not called CC=5 SCAR=34.0
Pod
documented
| |||||||||||||
| 24 | 0 | my $self = shift; | |||||||||||
| 25 | |||||||||||||
| 26 | 0 | ▶ | if (! $self->can('name')) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 27 | 0 | die ref($self)."->full_name() doesn't make contextual sense"; | |||||||||||
| 28 | } | ||||||||||||
| 29 | 0 | ▶ | if (! $self->{header}) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 30 | 0 | die ref($self)."->full_name() has no header to compute the full name from"; | |||||||||||
| 31 | } | ||||||||||||
| 32 | 0 | my @parts = split /\./, $self->name; | |||||||||||
| 33 | 0 | ▶ | if (int @parts > 1) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 34 | 0 | return $self->name; | |||||||||||
| 35 | } | ||||||||||||
| 36 | else { | ||||||||||||
| 37 | 0 | ▶ | return join '.', $self->{header}->basename || '', $self->name; | ||||||||||
|
Condition0%0/2
$self->{'header'}->basename || ''
MC/DC0%0/1
$self->{'header'}->basename || ''
$self->{'header'}->basename
Truth table0%0/2
A
A= $self->{'header'}->basename
| |||||||||||||
| 38 | } | ||||||||||||
| 39 | } | ||||||||||||
| 40 | |||||||||||||
| 41 | =head2 local_name | ||||||||||||
| 42 | |||||||||||||
| 43 | Returns the last part of the full_name. | ||||||||||||
| 44 | |||||||||||||
| 45 | =cut | ||||||||||||
| 46 | |||||||||||||
| 47 | 0 | ▶ | sub local_name { | ||||||||||
|
Subroutine
local_name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||||
| 48 | 0 | my $self = shift; | |||||||||||
| 49 | 0 | ▶ | if (! $self->can('name')) { | ||||||||||
|
Branch: 1 branch
| |||||||||||||
| 50 | 0 | die ref($self)."->local_name() doesn't make contextual sense"; | |||||||||||
| 51 | } | ||||||||||||
| 52 | 0 | my @parts = split /\./, $self->name; | |||||||||||
| 53 | 0 | return $parts[ $#parts ]; | |||||||||||
| 54 | } | ||||||||||||
| 55 | |||||||||||||
| 56 | 4 | 1; | |||||||||||