| 1 | package Net::Gnats::Command::ADMV; | ||||||||||
| 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::ADMV::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_INVALID_FIELD_NAME CODE_NO_ADM_ENTRY CODE_INFORMATION); | ||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||
| 10 | |||||||||||
| 11 | =head1 NAME | ||||||||||
| 12 | |||||||||||
| 13 | Net::Gnats::Command::ADMV | ||||||||||
| 14 | |||||||||||
| 15 | =head1 DESCRIPTION | ||||||||||
| 16 | |||||||||||
| 17 | Returns an entry from an administrative data file associated with | ||||||||||
| 18 | field. key is used to look up the entry in the data file. If | ||||||||||
| 19 | subfield is specified, only the value of that subfield is returned; | ||||||||||
| 20 | otherwise, all of the fields in the adm data file are returned, | ||||||||||
| 21 | separated by colons :. | ||||||||||
| 22 | |||||||||||
| 23 | =head1 RESPONSES | ||||||||||
| 24 | |||||||||||
| 25 | The responses are: | ||||||||||
| 26 | |||||||||||
| 27 | 410 (CODE_INVALID_FIELD_NAME) The specified field does not exist. | ||||||||||
| 28 | |||||||||||
| 29 | 221 (CODE_NO_ADM_ENTRY) An adm entry matching the key was not found, | ||||||||||
| 30 | or the field does not have an adm file associated with it. | ||||||||||
| 31 | |||||||||||
| 32 | 350 (CODE_INFORMATION) The normal response; the supplied text is the | ||||||||||
| 33 | requested field(s). | ||||||||||
| 34 | |||||||||||
| 35 | =head1 EXAMPLES | ||||||||||
| 36 | |||||||||||
| 37 | my $entry = Net::Gnats::Command::ADMV->new( field => myfield, key => mykey )->as_string; | ||||||||||
| 38 | |||||||||||
| 39 | =cut | ||||||||||
| 40 | |||||||||||
| 41 | 40 | my $c = 'ADMV'; | |||||||||
| 42 | |||||||||||
| 43 | 3 | ▶ | sub new { | ||||||||
|
Subroutine
new: called CC=2 SCAR=6.9
Pod
documented
| |||||||||||
| 44 | 3 | my ( $class, %options ) = @_; | |||||||||
| 45 | 3 | ▶ | return bless {}, $class if not %options; | ||||||||
|
Branch: 1 branch
| |||||||||||
| 46 | 1 | my $self = bless \%options, $class; | |||||||||
| 47 | 1 | return $self; | |||||||||
| 48 | } | ||||||||||
| 49 | |||||||||||
| 50 | 1 | ▶ | sub field_name { return shift->{field_name}; } | ||||||||
|
Subroutine
field_name: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 51 | |||||||||||
| 52 | 1 | ▶ | sub key { return shift->{key}; } | ||||||||
|
Subroutine
key: called CC=1 SCAR=0.0
Pod
undocumented
| |||||||||||
| 53 | |||||||||||
| 54 | 1 | ▶ | sub as_string { | ||||||||
|
Subroutine
as_string: called CC=1 SCAR=0.0
Pod
documented
| |||||||||||
| 55 | 1 | my $self = shift; | |||||||||
| 56 | 1 | return $c . ' ' . $self->field_name . ' ' . $self->key; | |||||||||
| 57 | } | ||||||||||
| 58 | |||||||||||
| 59 | 40 | 1; | |||||||||