File Coverage

blib/lib/WebService/ScormCloud/Service/Reporting.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 WebService::ScormCloud::Service::Reporting;
2              
3 1     1   2076 use Moose::Role;
  0            
  0            
4              
5             with 'WebService::ScormCloud::Service';
6              
7             =head1 NAME
8              
9             WebService::ScormCloud::Service::Reporting - ScormCloud API "reporting" namespace
10              
11             =head1 VERSION
12              
13             Version 0.03
14              
15             =cut
16              
17             our $VERSION = '0.03';
18              
19             =head1 SYNOPSIS
20              
21             use WebService::ScormCloud;
22              
23             my $ScormCloud = WebService::ScormCloud->new(
24             app_id => '12345678',
25             secret_key => 'ABCDEFGHIJKLMNOPQRSTUVWXYZ',
26             );
27              
28             my $account_info = $ScormCloud->getAccountInfo;
29              
30             print "The contact email for "
31             . $account_info->{company} . " is "
32             . $account_info->{email} . "\n";
33              
34             print "There are "
35             . $account_info->{usage}->{totalcourses}
36             . " courses and "
37             . $account_info->{usage}->{totalregistrations}
38             . " registrations available.\n";
39              
40             =head1 DESCRIPTION
41              
42             This module defines L<WebService::ScormCloud> API methods in the "course"
43             namespace. See L<WebService::ScormCloud> for more info.
44              
45             =cut
46              
47             requires 'process_request';
48              
49             =head1 METHODS
50              
51             =head2 getAccountInfo
52              
53             Return a hashref containing account info.
54             The hash might be empty in case of failure.
55              
56             =cut
57              
58             sub getAccountInfo ## no critic (NamingConventions::Capitalization)
59             {
60             my ($self) = @_;
61              
62             return $self->process_request(
63             {method => 'reporting.getAccountInfo'},
64             sub {
65             my ($response) = @_;
66              
67             return $response->{account};
68             }
69             );
70             }
71              
72             1;
73              
74             =head1 SEE ALSO
75              
76             L<WebService::ScormCloud>
77              
78             __END__
79              
80             =head1 AUTHOR
81              
82             Larry Leszczynski, C<< <larryl at cpan.org> >>
83              
84             =head1 BUGS
85              
86             Please report any bugs or feature requests to C<bug-scormcloud at rt.cpan.org>, or through
87             the web interface at L<http://rt.cpan.org/NoAuth/ReportBug.html?Queue=WebService-ScormCloud>. I will be notified, and then you'll
88             automatically be notified of progress on your bug as I make changes.
89              
90             Patches more than welcome, especially via GitHub:
91             L<https://github.com/larryl/ScormCloud>
92              
93             =head1 SUPPORT
94              
95             You can find documentation for this module with the perldoc command.
96              
97             perldoc WebService::ScormCloud::Service::Reporting
98              
99             You can also look for information at:
100              
101             =over 4
102              
103             =item * GitHub
104              
105             L<https://github.com/larryl/ScormCloud>
106              
107             =item * RT: CPAN's request tracker
108              
109             L<http://rt.cpan.org/NoAuth/Bugs.html?Dist=WebService-ScormCloud>
110              
111             =item * AnnoCPAN: Annotated CPAN documentation
112              
113             L<http://annocpan.org/dist/WebService-ScormCloud>
114              
115             =item * CPAN Ratings
116              
117             L<http://cpanratings.perl.org/d/WebService-ScormCloud>
118              
119             =item * Search CPAN
120              
121             L<http://search.cpan.org/dist/WebService-ScormCloud/>
122              
123             =back
124              
125             =head1 ACKNOWLEDGEMENTS
126              
127              
128             =head1 COPYRIGHT & LICENSE
129              
130             Copyright 2010 Larry Leszczynski.
131              
132             This program is free software; you can redistribute it and/or modify it
133             under the terms of either: the GNU General Public License as published
134             by the Free Software Foundation; or the Artistic License.
135              
136             See http://dev.perl.org/licenses/ for more information.
137              
138             =cut
139