| 1 | package Net::Gnats::Command::QUIT; | ||||||||||
| 2 | 40 | ▶ | use parent 'Net::Gnats::Command'; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 3 | 40 | ▶ | use strictures; | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 4 | 40 | ▶ | BEGIN { | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 5 | 40 | $Net::Gnats::Command::QUIT::VERSION = '0.22'; | |||||||||
| 6 | } | ||||||||||
| 7 | 40 | ▶ | use vars qw($VERSION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 8 | |||||||||||
| 9 | 40 | ▶ | use Net::Gnats::Constants qw(CODE_CLOSING); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | QUIT | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | Requests that the connection be closed. | ||||||||||
| 18 | |||||||||||
| 19 | The QUIT command has the dubious distinction of being the only | ||||||||||
| 20 | command that cannot fail. | ||||||||||
| 21 | |||||||||||
| 22 | =head1 PROTOCOL | ||||||||||
| 23 | |||||||||||
| 24 | QUIT | ||||||||||
| 25 | |||||||||||
| 26 | =head1 RESPONSES | ||||||||||
| 27 | |||||||||||
| 28 | Possible responses: | ||||||||||
| 29 | 201 (CODE_CLOSING) Normal exit. | ||||||||||
| 30 | |||||||||||
| 31 | =cut | ||||||||||
| 32 | |||||||||||
| 33 | 40 | my $c = 'QUIT'; | |||||||||
| 34 | |||||||||||
| 35 | 5 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 36 | 5 | my ( $class, %options ) = @_; | |||||||||
| 37 | 5 | my $self = bless {}, $class; | |||||||||
| 38 | 5 | return $self; | |||||||||
| 39 | } | ||||||||||
| 40 | |||||||||||
| 41 | 10 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 42 | 10 | my ($self) = @_; | |||||||||
| 43 | 10 | return $c; | |||||||||
| 44 | } | ||||||||||
| 45 | |||||||||||
| 46 | 4 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=4 SCAR=15.6
Pod
undocumented
| |||||||||||
| 47 | 4 | my ($self) = @_; | |||||||||
| 48 | 4 | ▶ | return 0 if not defined $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 49 | 4 | ▶ | return 0 if not defined $self->response->code; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 50 | 4 | ▶ | return 1 if $self->response->code == CODE_CLOSING; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 51 | 0 | return 0; | |||||||||
| 52 | } | ||||||||||
| 53 | |||||||||||
| 54 | 40 | 1; | |||||||||