| 1 | |||||||||||
| 2 | package Net::OBEX::Packet::Headers::Base; | ||||||||||
| 3 | |||||||||||
| 4 | 13 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 13 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 6 | 13 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 7 | |||||||||||
| 8 | 13 | our $VERSION = '1.001002'; # VERSION | |||||||||
| 9 | |||||||||||
| 10 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=3 SCAR=24.8
Pod
undocumented
| |||||||||||
| 11 | 0 | my ( $class, $hi, $value ) = @_; | |||||||||
| 12 | |||||||||||
| 13 | 0 | ▶ | croak "Missing header name or HI identifier" | ||||||||
|
Branch: 1 branch
| |||||||||||
| 14 | unless defined $hi; | ||||||||||
| 15 | |||||||||||
| 16 | 0 | ▶ | $value = '' | ||||||||
|
Branch: 1 branch
| |||||||||||
| 17 | unless defined $value; | ||||||||||
| 18 | |||||||||||
| 19 | 0 | return bless { | |||||||||
| 20 | value => $value, | ||||||||||
| 21 | hi => $hi, | ||||||||||
| 22 | }, $class; | ||||||||||
| 23 | } | ||||||||||
| 24 | |||||||||||
| 25 | 4 | ▶ | sub make { | ||||||||
|
Subroutine
make: called CC=2 SCAR=7.2
Pod
undocumented
| |||||||||||
| 26 | 4 | my $self = shift; | |||||||||
| 27 | |||||||||||
| 28 | 4 | my $value = $self->value; | |||||||||
| 29 | 4 | ▶ | unless ( length $value ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 30 | 0 | return $self->hi; | |||||||||
| 31 | } | ||||||||||
| 32 | |||||||||||
| 33 | 4 | my $header = $self->hi . $value; | |||||||||
| 34 | 4 | return $self->header($header); | |||||||||
| 35 | } | ||||||||||
| 36 | |||||||||||
| 37 | 17 | ▶ | sub header { | ||||||||
|
Subroutine
header: called CC=2 SCAR=7.0
Pod
undocumented
| |||||||||||
| 38 | 17 | my $self = shift; | |||||||||
| 39 | 17 | ▶ | if ( @_ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 40 | 17 | $self->{ header } = shift; | |||||||||
| 41 | } | ||||||||||
| 42 | 17 | return $self->{ header }; | |||||||||
| 43 | } | ||||||||||
| 44 | |||||||||||
| 45 | 17 | ▶ | sub value { | ||||||||
|
Subroutine
value: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||
| 46 | 17 | my $self = shift; | |||||||||
| 47 | 17 | ▶ | if ( @_ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 48 | 0 | $self->{ value } = shift; | |||||||||
| 49 | } | ||||||||||
| 50 | 17 | return $self->{ value }; | |||||||||
| 51 | } | ||||||||||
| 52 | |||||||||||
| 53 | 17 | ▶ | sub hi { | ||||||||
|
Subroutine
hi: called CC=2 SCAR=7.6
Pod
undocumented
| |||||||||||
| 54 | 17 | my $self = shift; | |||||||||
| 55 | 17 | ▶ | if ( @_ ) { | ||||||||
|
Branch: 1 branch
| |||||||||||
| 56 | 0 | $self->{ hi } = shift; | |||||||||
| 57 | } | ||||||||||
| 58 | 17 | return $self->{ hi }; | |||||||||
| 59 | } | ||||||||||
| 60 | |||||||||||
| 61 | 13 | 1; | |||||||||
| 62 | |||||||||||
| 63 | __END__ | ||||||||||