| 1 | package Net::Gnats::Command::FVLD; | ||||||||||
| 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::FVLD::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_TEXT_READY CODE_INVALID_FIELD_NAME); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | Net::Gnats::Command::FVLD | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | Returns one or more regular expressions or strings that describe the | ||||||||||
| 18 | valid types of data that can be placed in field. Exactly what is | ||||||||||
| 19 | returned is dependent on the type of data that can be stored in the | ||||||||||
| 20 | field. For most fields a regular expression is returned; for | ||||||||||
| 21 | enumerated fields, the returned values are the list of legal strings | ||||||||||
| 22 | that can be held in the field. | ||||||||||
| 23 | |||||||||||
| 24 | =head1 PROTOCOL | ||||||||||
| 25 | |||||||||||
| 26 | FVLD [field] | ||||||||||
| 27 | |||||||||||
| 28 | =head1 RESPONSES | ||||||||||
| 29 | |||||||||||
| 30 | The possible responses are: | ||||||||||
| 31 | |||||||||||
| 32 | 301 (CODE_TEXT_READY) | ||||||||||
| 33 | |||||||||||
| 34 | The normal response, which is followed by the list of regexps or | ||||||||||
| 35 | strings. | ||||||||||
| 36 | |||||||||||
| 37 | 410 (CODE_INVALID_FIELD_NAME) | ||||||||||
| 38 | |||||||||||
| 39 | The specified field does not exist. | ||||||||||
| 40 | |||||||||||
| 41 | =cut | ||||||||||
| 42 | |||||||||||
| 43 | 40 | my $c = 'FVLD'; | |||||||||
| 44 | |||||||||||
| 45 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 46 | 3 | my ( $class, %options ) = @_; | |||||||||
| 47 | |||||||||||
| 48 | 3 | my $self = bless \%options, $class; | |||||||||
| 49 | 3 | return $self; | |||||||||
| 50 | } | ||||||||||
| 51 | |||||||||||
| 52 | 9 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 53 | 9 | my $self = shift; | |||||||||
| 54 | 9 | ▶ | return undef if not defined $self->{field}; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 55 | 8 | return $c . ' ' . $self->{field}; | |||||||||
| 56 | } | ||||||||||
| 57 | |||||||||||
| 58 | 3 | ▶ | sub is_ok { | ||||||||
|
Subroutine
is_ok: called CC=3 SCAR=11.4
Pod
undocumented
| |||||||||||
| 59 | 3 | my $self = shift; | |||||||||
| 60 | 3 | ▶ | return 0 if not defined $self->response; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 61 | 2 | ▶ | return 1 if $self->response->code == CODE_TEXT_READY; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 62 | 0 | return 0; | |||||||||
| 63 | } | ||||||||||
| 64 | |||||||||||
| 65 | 40 | 1; | |||||||||