| 1 | package Catalyst::Helper::Model::EVDB; | ||||||||||||
| 2 | |||||||||||||
| 3 | 1 | ▶ | use strict; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 4 | 1 | ▶ | use warnings; | ||||||||||
|
Subroutine
BEGIN: called CC=1 SCAR=0.0
| |||||||||||||
| 5 | |||||||||||||
| 6 | =head1 NAME | ||||||||||||
| 7 | |||||||||||||
| 8 | Catalyst::Helper::Model::EVDB - Helper for EVDB models | ||||||||||||
| 9 | |||||||||||||
| 10 | =head1 SYNOPSIS | ||||||||||||
| 11 | |||||||||||||
| 12 | script/myapp_create.pl model EVDB EVDB app_key username password | ||||||||||||
| 13 | |||||||||||||
| 14 | =head1 DESCRIPTION | ||||||||||||
| 15 | |||||||||||||
| 16 | Helper for the L<Catalyst> EVDB model. | ||||||||||||
| 17 | |||||||||||||
| 18 | =head1 USAGE | ||||||||||||
| 19 | |||||||||||||
| 20 | When creating a new EVDB model class using this helper, you can | ||||||||||||
| 21 | specify much of the configuration and have it filled automatically. | ||||||||||||
| 22 | Using the example from the L</SYNOPSIS> section: | ||||||||||||
| 23 | |||||||||||||
| 24 | =over | ||||||||||||
| 25 | |||||||||||||
| 26 | =item * C<EVDB> | ||||||||||||
| 27 | |||||||||||||
| 28 | The name of the model. This is also used to determine the filename, | ||||||||||||
| 29 | e.g. C<lib/MyApp/Model/EVDB.pm>. | ||||||||||||
| 30 | |||||||||||||
| 31 | =item * C<EVDB> | ||||||||||||
| 32 | |||||||||||||
| 33 | The helper to use, i.e. this one. | ||||||||||||
| 34 | |||||||||||||
| 35 | =item * C<app_key> | ||||||||||||
| 36 | |||||||||||||
| 37 | Your application key, as provided by EVDB. Please see | ||||||||||||
| 38 | L<http://api.evdb.com/> to obtain an application key. | ||||||||||||
| 39 | |||||||||||||
| 40 | =item * C<username> | ||||||||||||
| 41 | |||||||||||||
| 42 | (Optional) Your EVDB username. | ||||||||||||
| 43 | |||||||||||||
| 44 | =item * C<password> | ||||||||||||
| 45 | |||||||||||||
| 46 | (Optional) Your EVDB password. | ||||||||||||
| 47 | |||||||||||||
| 48 | =back | ||||||||||||
| 49 | |||||||||||||
| 50 | =head1 METHODS | ||||||||||||
| 51 | |||||||||||||
| 52 | =head2 mk_compclass | ||||||||||||
| 53 | |||||||||||||
| 54 | Makes the EVDB model class. | ||||||||||||
| 55 | |||||||||||||
| 56 | =cut | ||||||||||||
| 57 | |||||||||||||
| 58 | 0 | ▶ | sub mk_compclass { | ||||||||||
|
Subroutine
mk_compclass: not called CC=4 SCAR=30.0
Pod
documented
| |||||||||||||
| 59 | 0 | my ($self, $helper, $app_key, $username, $password) = @_; | |||||||||||
| 60 | |||||||||||||
| 61 | 0 | ▶ | $helper->{app_key} = $app_key || ''; | ||||||||||
|
Condition0%0/2
$app_key || ''
MC/DC0%0/1
$app_key || ''
$app_key
Truth table0%0/2
A
A= $app_key
| |||||||||||||
| 62 | 0 | ▶ | $helper->{username} = $username || ''; | ||||||||||
|
Condition0%0/2
$username || ''
MC/DC0%0/1
$username || ''
$username
Truth table0%0/2
A
A= $username
| |||||||||||||
| 63 | 0 | ▶ | $helper->{password} = $password || ''; | ||||||||||
|
Condition0%0/2
$password || ''
MC/DC0%0/1
$password || ''
$password
Truth table0%0/2
A
A= $password
| |||||||||||||
| 64 | |||||||||||||
| 65 | 0 | $helper->render_file('modelclass', $helper->{file}); | |||||||||||
| 66 | |||||||||||||
| 67 | 0 | return 1; | |||||||||||
| 68 | } | ||||||||||||
| 69 | |||||||||||||
| 70 | =head2 mk_comptest | ||||||||||||
| 71 | |||||||||||||
| 72 | Makes tests for the EVDB model. | ||||||||||||
| 73 | |||||||||||||
| 74 | =cut | ||||||||||||
| 75 | |||||||||||||
| 76 | 0 | ▶ | sub mk_comptest { | ||||||||||
|
Subroutine
mk_comptest: not called CC=1 SCAR=6.9
Pod
documented
| |||||||||||||
| 77 | 0 | my ($self, $helper) = @_; | |||||||||||
| 78 | |||||||||||||
| 79 | 0 | $helper->render_file('modeltest', $helper->{test}); | |||||||||||
| 80 | } | ||||||||||||
| 81 | |||||||||||||
| 82 | =head1 SEE ALSO | ||||||||||||
| 83 | |||||||||||||
| 84 | =over 4 | ||||||||||||
| 85 | |||||||||||||
| 86 | =item * L<Catalyst::Manual> | ||||||||||||
| 87 | |||||||||||||
| 88 | =item * L<Catalyst::Test> | ||||||||||||
| 89 | |||||||||||||
| 90 | =item * L<Catalyst::Helper> | ||||||||||||
| 91 | |||||||||||||
| 92 | =back | ||||||||||||
| 93 | |||||||||||||
| 94 | =head1 AUTHOR | ||||||||||||
| 95 | |||||||||||||
| 96 | Daniel Westermann-Clark E<lt>danieltwc@cpan.orgE<gt> | ||||||||||||
| 97 | |||||||||||||
| 98 | =head1 LICENSE | ||||||||||||
| 99 | |||||||||||||
| 100 | This library is free software; you can redistribute it and/or modify | ||||||||||||
| 101 | it under the same terms as Perl itself. | ||||||||||||
| 102 | |||||||||||||
| 103 | =cut | ||||||||||||
| 104 | |||||||||||||
| 105 | 1 | 1; | |||||||||||
| 106 | |||||||||||||
| 107 | __DATA__ | ||||||||||||