Helper/Model/XMLRPC.pm

filter: Statementstmt 53.8% 7 / 13 Branchbran n/a Conditioncond 0.0% 0 / 2 MC/DCmcdc 0.0% 0 / 1 Subroutinesub 50.0% 2 / 4 Podpod 100% 2 / 2 totaltotal 50.0% 11 / 22 CC 2 SCAR 11.6
CC
2
Cov
47%
mk_compclass
6.0
mk_comptest
2.0
BEGIN
1.0
CRAP 3.2
« Model/XMLRPC.pm ↑ Summary
1 package Catalyst::Helper::Model::XMLRPC;
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::XMLRPC - Helper for XMLRPC models
8  
9 =head1 SYNOPSIS
10  
11 script/myapp_create.pl model RemoteService XMLRPC http://webservice.example.com:9000
12  
13 =head1 DESCRIPTION
14  
15 Helper for the L<Catalyst> XMLRPC model.
16  
17 =head1 USAGE
18  
19 When creating a new XMLRPC 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<XMLRPC>
31  
32 The helper to use, i.e. this one.
33  
34 =item * C<http://webservice.example.com:9000>
35  
36 The XMLRPC webservice fully qualified domain name (FQDN). Can also be an
37 IP address, e.g. C<127.0.0.1>. Followed by the port number, separated by
38 colons.
39  
40 =back
41  
42 =head1 METHODS
43  
44 =head2 mk_compclass
45  
46 Makes the XMLRPC model class.
47  
48 =cut
49  
50 0 ▶sub mk_compclass {
Subroutine mk_compclass: not called CC=2 SCAR=17.9
Pod documented
51 0 my ($self, $helper, $location) = @_;
52  
53 0 ▶ $helper->{location} = $location || '';
Condition0%0/2
$location || ''
l!l
00
MC/DC0%0/1
$location || ''
$location
Truth table0%0/2
A
A= $location
Aresult
11
00
54  
55 0 $helper->render_file('modelclass', $helper->{file});
56  
57 0 return 1;
58 }
59  
60 =head2 mk_comptest
61  
62 Makes tests for the XMLRPC model.
63  
64 =cut
65  
66 0 ▶sub mk_comptest {
Subroutine mk_comptest: not called CC=1 SCAR=6.9
Pod documented
67 0 my ($self, $helper) = @_;
68  
69 0 $helper->render_file('modeltest', $helper->{test});
70 }
71  
72 =head1 SEE ALSO
73  
74 =over 1
75  
76 =item * L<Catalyst::Model::XMLRPC>
77  
78 =item * L<Catalyst::Helper>
79  
80 =item * L<Catalyst::Manual>
81  
82 =back
83  
84 =head1 ACKNOWLEDGEMENTS
85  
86 =over 1
87  
88 =item * Daniel Westermann-Clark's module, L<Catalyst::Model::LDAP>, it was my reference.
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__
« Model/XMLRPC.pm ↑ Summary