Helper/Model/JabberRPC.pm

filter: Statementstmt 46.6% 7 / 15 Branchbran n/a Conditioncond 0.0% 0 / 6 MC/DCmcdc 0.0% 0 / 3 Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 36.6% 11 / 30 CC 4 SCAR 24.8
CC
4
Cov
33%
mk_compclass
20.0
mk_comptest
2.0
BEGIN
1.0
CRAP 12.0
↑ Summary Model/JabberRPC.pm »
1 package Catalyst::Helper::Model::JabberRPC;
2 1 ▶use strict;
Subroutine BEGIN: called CC=1 SCAR=0.0
3 1 ▶use warnings;
Subroutine BEGIN: called CC=1 SCAR=0.0
4  
5 =head1 NAME
6  
7 Catalyst::Helper::Model::JabberRPC - Helper for JabberRPC models
8  
9 =head1 SYNOPSIS
10  
11 script/myapp_create.pl model RemoteService JabberRPC myserver.org user:password jrpc.myserver.org/rpc-server
12  
13 =head1 DESCRIPTION
14  
15 Helper for the L<Catalyst> JabberRPC model.
16  
17 =head1 USAGE
18  
19 When creating a new JabberRPC model class using this helper, you can
20 specify much of the configuration and have it filled automatically.
21 Using the example from the L</SYNOPSIS> section:
22  
23 =over
24  
25 =item * C<RemoteService>
26  
27 The name of the model. This is also used to determine the filename,
28 e.g. C<lib/MyApp/Model/RemoteService.pm>.
29  
30 =item * C<JabberRPC>
31  
32 The helper to use, i.e. this one.
33  
34 =item * C<myserver.org>
35  
36 The same as the B<server> arg. passed to L<Jabber::RPC::Client>.
37  
38 =item * C<user:password>
39  
40 The same as the B<identauth> arg. passed to L<Jabber::RPC::Client>.
41  
42 =item * C<jrpc.myserver.org/rpc-server>
43  
44 The same as the B<endpoint> arg. passed to L<Jabber::RPC::Client>.
45  
46 =back
47  
48 =head1 METHODS
49  
50 =head2 mk_compclass
51  
52 Makes the JabberRPC model class.
53  
54 =cut
55  
56 0 ▶sub mk_compclass {
Subroutine mk_compclass: not called CC=4 SCAR=30.0
Pod documented
57 0 my ($self, $helper, $server, $identauth, $endpoint) = @_;
58  
59 0 ▶ $helper->{server} = $server || '';
Condition0%0/2
$server || ''
l!l
00
MC/DC0%0/1
$server || ''
$server
Truth table0%0/2
A
A= $server
Aresult
11
00
60 0 ▶ $helper->{identauth} = $identauth || '';
Condition0%0/2
$identauth || ''
l!l
00
MC/DC0%0/1
$identauth || ''
$identauth
Truth table0%0/2
A
A= $identauth
Aresult
11
00
61 0 ▶ $helper->{endpoint} = $endpoint || '';
Condition0%0/2
$endpoint || ''
l!l
00
MC/DC0%0/1
$endpoint || ''
$endpoint
Truth table0%0/2
A
A= $endpoint
Aresult
11
00
62  
63 0 $helper->render_file('modelclass', $helper->{file});
64  
65 0 return 1;
66 }
67  
68 =head2 mk_comptest
69  
70 Makes tests for the JabberRPC model.
71  
72 =cut
73  
74 0 ▶sub mk_comptest {
Subroutine mk_comptest: not called CC=1 SCAR=6.9
Pod documented
75 0 my ($self, $helper) = @_;
76  
77 0 $helper->render_file('modeltest', $helper->{test});
78 }
79  
80 =head1 SEE ALSO
81  
82 =over 1
83  
84 =item * L<Catalyst::Model::JabberRPC>
85  
86 =item * L<Catalyst::Helper>
87  
88 =item * L<Catalyst::Manual>
89  
90 =back
91  
92 =head1 AUTHOR
93  
94 Florian Merges E<lt>fmerges@cpan.orgE<gt>
95  
96 =head1 LICENSE
97  
98 This library is free software; you can redistribute it and/or modify
99 it under the same terms as Perl itself.
100  
101 =cut
102  
103 1 1;
104  
105 __DATA__
↑ Summary Model/JabberRPC.pm »