| 1 | package Net::FSP::Entry; | ||||||||||
| 2 | 2 | ▶ | use strict; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 2 | ▶ | use warnings; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 2 | ▶ | use Carp; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | |||||||||||
| 6 | 2 | ▶ | use overload q{""} => sub { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.2
Subroutine
__ANON__: not called CC=1 SCAR=6.9
| |||||||||||
| 7 | 0 | return $_[0]->short_name; | |||||||||
| 8 | 2 | }; | |||||||||
| 9 | 2 | our $VERSION = $Net::FSP::VERSION; | |||||||||
| 10 | |||||||||||
| 11 | 0 | ▶ | sub new { | ||||||||
|
Subroutine
new: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 12 | 0 | my ($class, $fsp, $name, %attributes) = @_; | |||||||||
| 13 | 0 | $name =~ s{ \A / }{}mx; | |||||||||
| 14 | 0 | return bless { | |||||||||
| 15 | fsp => $fsp, | ||||||||||
| 16 | name => $name, | ||||||||||
| 17 | %attributes, | ||||||||||
| 18 | }, $class; | ||||||||||
| 19 | } | ||||||||||
| 20 | |||||||||||
| 21 | 2 | for my $subname (qw/name type size time link/) { | |||||||||
| 22 | 2 | ▶ | no strict 'refs'; ##no critic strict | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 23 | 10 | ▶ | *{$subname} = sub { | ||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=1.2
| |||||||||||
| 24 | 0 | return $_[0]{$subname}; | |||||||||
| 25 | 10 | }; | |||||||||
| 26 | } | ||||||||||
| 27 | |||||||||||
| 28 | 0 | ▶ | sub move { | ||||||||
|
Subroutine
move: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||
| 29 | 0 | my ($self, $new_name) = @_; | |||||||||
| 30 | 0 | $self->{fsp}->move_file($self->{name}, $new_name); | |||||||||
| 31 | 0 | return; | |||||||||
| 32 | } | ||||||||||
| 33 | |||||||||||
| 34 | 0 | ▶ | sub short_name { | ||||||||
|
Subroutine
short_name: not called CC=2 SCAR=17.9
Pod
documented
| |||||||||||
| 35 | 0 | my $self = shift; | |||||||||
| 36 | 0 | ▶ | $self->{name} =~ / ( [^\/]* ) \z /mx or croak "Couldn't determine short_name"; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 37 | 0 | return $1; | |||||||||
| 38 | } | ||||||||||
| 39 | |||||||||||
| 40 | sub accept; | ||||||||||
| 41 | sub remove; | ||||||||||
| 42 | sub download; | ||||||||||
| 43 | |||||||||||
| 44 | 2 | 1; | |||||||||
| 45 | |||||||||||
| 46 | __END__ | ||||||||||