| 1 | package AnyEvent::Finger::Request; | ||||||||||||||
| 2 | |||||||||||||||
| 3 | 6 | ▶ | use strict; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 4 | 6 | ▶ | use warnings; | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||||
| 5 | use overload | ||||||||||||||
| 6 | 12 | ▶ | '""' => sub { shift->as_string }, | ||||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.1
Subroutine
__ANON__: called CC=1 SCAR=0.0
| |||||||||||||||
| 7 | 0 | ▶ | bool => sub { 1 }, fallback => 1; | ||||||||||||
|
Subroutine
__ANON__: not called CC=1 SCAR=0.2
| |||||||||||||||
| 8 | |||||||||||||||
| 9 | # ABSTRACT: Simple asynchronous finger request | ||||||||||||||
| 10 | 6 | our $VERSION = '0.14'; # VERSION | |||||||||||||
| 11 | |||||||||||||||
| 12 | |||||||||||||||
| 13 | sub new | ||||||||||||||
| 14 | 28 | ▶ | { | ||||||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 15 | 28 | bless { raw => "$_[1]" }, $_[0]; | |||||||||||||
| 16 | } | ||||||||||||||
| 17 | |||||||||||||||
| 18 | |||||||||||||||
| 19 | sub verbose | ||||||||||||||
| 20 | 18 | ▶ | { | ||||||||||||
|
Subroutine
verbose: called CC=3 SCAR=11.1
Pod
documented
| |||||||||||||||
| 21 | 18 | my($self) = @_; | |||||||||||||
| 22 | 18 | ▶ | defined $self->{verbose} ? $self->{verbose} : $self->{verbose} = ($self->{raw} =~ /^\/W/ ? 1 : 0); | ||||||||||||
|
Branch: 2 branches
| |||||||||||||||
| 23 | } | ||||||||||||||
| 24 | |||||||||||||||
| 25 | |||||||||||||||
| 26 | sub username | ||||||||||||||
| 27 | 39 | ▶ | { | ||||||||||||
|
Subroutine
username: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||
| 28 | 39 | my($self) = @_; | |||||||||||||
| 29 | |||||||||||||||
| 30 | 39 | ▶ | unless(defined $self->{username}) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 31 | { | ||||||||||||||
| 32 | 22 | ▶ | if($self->{raw} =~ /^(?:\/W\s*)?([^@]*)/) | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 33 | 22 | { $self->{username} = $1 } | |||||||||||||
| 34 | } | ||||||||||||||
| 35 | |||||||||||||||
| 36 | 39 | $self->{username}; | |||||||||||||
| 37 | } | ||||||||||||||
| 38 | |||||||||||||||
| 39 | |||||||||||||||
| 40 | sub hostnames | ||||||||||||||
| 41 | 54 | ▶ | { | ||||||||||||
|
Subroutine
hostnames: called CC=3 SCAR=11.0
Pod
documented
| |||||||||||||||
| 42 | 54 | my($self) = @_; | |||||||||||||
| 43 | 54 | ▶ | return $self->{hostnames} if defined $self->{hostnames}; | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 44 | 28 | ▶ | $self->{hostnames} = ($self->{raw} =~ /\@(.*)$/ ? [split /\@/, $1] : []); | ||||||||||||
|
Branch: 1 branch
| |||||||||||||||
| 45 | } | ||||||||||||||
| 46 | |||||||||||||||
| 47 | |||||||||||||||
| 48 | sub as_string | ||||||||||||||
| 49 | 12 | ▶ | { | ||||||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||||||
| 50 | 12 | my($self) = @_; | |||||||||||||
| 51 | 12 | join('@', ($self->username, @{ $self->hostnames })); | |||||||||||||
| 52 | } | ||||||||||||||
| 53 | |||||||||||||||
| 54 | |||||||||||||||
| 55 | 8 | ▶ | sub listing_request { shift->username eq '' ? 1 : 0 } | ||||||||||||
|
Subroutine
listing_request: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||
| 56 | |||||||||||||||
| 57 | |||||||||||||||
| 58 | |||||||||||||||
| 59 | 23 | ▶ | sub forward_request { @{ shift->hostnames } > 0 ? 1 : 0} | ||||||||||||
|
Subroutine
forward_request: called CC=2 SCAR=6.9
Pod
documented
Branch: 1 branch
| |||||||||||||||
| 60 | |||||||||||||||
| 61 | 6 | 1; | |||||||||||||
| 62 | |||||||||||||||
| 63 | __END__ | ||||||||||||||