File Coverage

blib/lib/Catalyst/Model/SMS.pm
Criterion Covered Total %
statement 1 3 33.3
branch n/a
condition n/a
subroutine 1 1 100.0
pod n/a
total 2 4 50.0


line stmt bran cond sub pod time code
1             package Catalyst::Model::SMS;
2 2     2   7905 use Moose;
  0            
  0            
3             use SMS::Send;
4             extends 'Catalyst::Model::Adaptor';
5              
6             # ABSTRACT: Easy SMS sending from Catalyst Apps.
7              
8             our $VERSION = '0.4';
9              
10             __PACKAGE__->config( class => 'SMS::Send' );
11              
12             has driver => (
13             is => 'ro',
14             isa => 'Str',
15             default => 'Test',
16             );
17              
18             sub mangle_arguments {
19             my ( $self, $args ) = @_;
20              
21             my $driver = delete $args->{driver} || $self->driver;
22             return $driver, %$args;
23             }
24              
25             __PACKAGE__->meta->make_immutable;
26             1;
27              
28              
29             __PACKAGE__->meta->make_immutable;
30              
31             1;
32              
33             __END__
34              
35             =pod
36              
37             =head1 NAME
38              
39             Catalyst::Model::SMS - Easy SMS sending from Catalyst Apps.
40              
41             =head1 VERSION
42              
43             version 0.4
44              
45             =head1 SYNOPSIS
46              
47             # on the shell
48             $ script/myapp_create.pl model SMS
49              
50             # in myapp.conf
51             <Model::SMS>
52             driver Test
53             <args>
54             _login admin
55             _password pa55w0rD
56             </args>
57             </Model::SMS>
58              
59             =head1 DESCRIPTION
60              
61             L<Catalyst::Model::SMS> is a thin proxy around SMS::Send. It can
62             be initialized using the Catalyst configuration file or method.
63              
64             =head1 NAME
65              
66             Catalyst::Model::SMS - Catalyst Model for SMS::Send
67              
68             =head1 OPTIONS
69              
70             =head2 driver
71              
72             L<SMS::Send> driver name. You may specify 'Test' if you need a testing driver.
73             This module will default to 'Test' if this is not specified. See L<SMS::Send>
74             for more information.
75              
76             =head2 args
77              
78             L<SMS::Send> arguments specific to the selected driver. These options are
79             passed directly to the appropriate L<SMS::Send> driver.
80              
81             =head1 METHODS
82              
83             =head2 mangle_arguments
84              
85             overridden method imported from Catalyst::Model::Adaptor. This method is
86             passed the arguments, and returns them in a way suitable for SMS::Send->new
87              
88             =head1 AUTHOR
89              
90             Martin Atukunda, <matlads@cpan.org>
91              
92             =head1 COPYRIGHT
93              
94             Copyright 2013 the above author(s).
95              
96             =head1 LICENSE
97              
98             This sofware is free software, and is licensed under the same terms as perl itself.
99              
100             =head1 AUTHOR
101              
102             Martin Atukunda <matlads@cpan.org>
103              
104             =head1 COPYRIGHT AND LICENSE
105              
106             This software is copyright (c) 2013 by Martin Atukunda.
107              
108             This is free software; you can redistribute it and/or modify it under
109             the same terms as the Perl 5 programming language system itself.
110              
111             =cut