RRP/Request/Session.pm untested

filter: Statementstmt 0.0% 0 / 20 Branchbran n/a Conditioncond 0.0% 0 / 3 MC/DCmcdc 0.0% 0 / 2 Subroutinesub 0.0% 0 / 7 Podpod 0.0% 0 / 3 totaltotal 0.0% 0 / 35 CC 1 SCAR 6.9
CC
1
Cov
0%
getName
2.0
setEntity
2.0
setOption
2.0
CRAP 2.0
1 package Net::RRP::Request::Session;
2  
3 use strict;
4 use Net::RRP::Request;
5 use Net::RRP::Exception::InvalidCommandOption;
6 use Net::RRP::Exception::InvalidEntityValue;
7  
8 @Net::RRP::Request::Session::ISA = qw(Net::RRP::Request);
9 $Net::RRP::Request::Session::VERSION = '0.1';
10  
11 =head1 NAME
12  
13 Net::RRP::Request::Session - rrp session request representation.
14  
15 =head1 SYNOPSIS
16  
17 use Net::RRP::Request::Session;
18 my $sessionRequest = new Net::RRP::Request::Session ( Id => 'reg1',
19 Password => '***' );
20 my $sessionRequest1 = new Net::RRP::Request::Session ();
21 $sessionRequest1->setOption ( Id => 'reg1' );
22 $sessionRequest1->setOption ( Password => '***' );
23 $sessionRequest1->setOption ( NewPassword => '****' );
24  
25 =head1 DESCRIPTION
26  
27 This is a rrp session request representation class.
28  
29 =cut
30  
31 =head2 getName
32  
33 return a 'Session'
34  
35 =cut
36  
37 sub getName { 'Session' };
38  
39 =head2 setEntity
40  
41 throw Net::RRP::Exception::InvalidEntityValue immediate
42  
43 =cut
44  
45 sub setEntity
46 {
47 throw Net::RRP::Exception::InvalidEntityValue ();
48 }
49  
50 =head2 setOption
51  
52 Pass only Id, Password, NewPassword options
53  
54 =cut
55  
56 sub setOption
57 {
58 my ( $this, $key, $value ) = @_;
59 { id => 1, password => 1, newpassword => 1 }->{ lc ( $key ) } || throw Net::RRP::Exception::InvalidCommandOption ();
60 $this->SUPER::setOption ( $key => $value );
61 }
62  
63 =head1 AUTHOR AND COPYRIGHT
64  
65 Net::RRP::Request::Session (C) Michael Kulakov, Zenon N.S.P. 2000
66 125124, 19, 1-st Jamskogo polja st,
67 Moscow, Russian Federation
68  
69 mkul@cpan.org
70  
71 All rights reserved.
72  
73 You may distribute this package under the terms of either the GNU
74 General Public License or the Artistic License, as specified in the
75 Perl README file.
76  
77 =head1 SEE ALSO
78  
79 L<Net::RRP::Request(3)>, L<Net::RRP::Codec(3)>, RFC 2832,
80 L<Net::RRP::Exception::InvalidCommandOption(3)>,
81 L<Net::RRP::Exception::InvalidEntityValue(3)>
82  
83 =cut
84  
85 1;
86  
87 __END__