DataTables/SSP/Results.pm

filter: Statementstmt 85.7% 12 / 14 Branchbran n/a Conditioncond n/a MC/DCmcdc n/a Subroutinesub 66.6% 2 / 3 Podpod 100% 1 / 1 totaltotal 83.3% 15 / 18 CC 1 SCAR 2.9
CC
1
Cov
86%
TO_JSON
2.0
BEGIN
1.0
BEGIN
1.0
CRAP 1.3
« DataTables/SSP/Params.pm ↑ Summary DataTables/SSP/Column.pm »
1 package Mojolicious::Plugin::DataTables::SSP::Results;
2  
3 2 ▶use Mojo::Base -base;
Subroutine BEGIN: called CC=1 SCAR=0.0
4 2 ▶use Mojo::JSON qw(encode_json);
Subroutine BEGIN: called CC=1 SCAR=0.0
5  
6 2 our $VERSION = '2.01';
7  
8 2 has 'draw';
9 2 has 'records_total';
10 2 has 'records_filtered';
11 2 has 'data';
12  
13 0 ▶sub TO_JSON {
Subroutine TO_JSON: not called CC=1 SCAR=6.9
Pod documented
14  
15 0 my ($self) = @_;
16  
17 return {
18 0 draw => $self->draw,
19 recordsTotal => $self->records_total,
20 recordsFiltered => $self->records_filtered,
21 data => $self->data,
22 };
23  
24 }
25  
26 2 1;
27  
28 =encoding utf8
29  
30 =head1 NAME
31  
32 Mojolicious::Plugin::DataTables::SSP::Results - DataTables SSP Result Helper
33  
34 =head1 SYNOPSIS
35  
36 # Mojolicious
37 $self->plugin('DataTables');
38  
39 # Mojolicious::Lite
40 plugin 'DataTables';
41  
42 [...]
43  
44 $c->render(json => $c->datatable->ssp_results(
45 draw => 1,
46 data => \@results,
47 records_total => 100,
48 records_filtered => 0
49 ));
50  
51 =head1 DESCRIPTION
52  
53 L<Mojolicious::Plugin::DataTables::SSP::Results> is a L<Mojolicious> plugin to add DataTables SSP (Server-Side Protocol) support in your Mojolicious application.
54  
55  
56 =head1 METHODS
57  
58 L<Mojolicious::Plugin::DataTables::SSP::Results> implements the following methods.
59  
60 =head2 draw
61  
62 =head2 records_total
63  
64 =head2 records_filtered
65  
66 =head2 data
67  
68 =head2 TO_JSON
69  
70  
71 =head1 SEE ALSO
72  
73 L<Mojolicious>, L<Mojolicious::Guides>, L<https://mojolicious.org>, L<Mojolicious::Plugin::DataTables>, L<Mojolicious::Plugin::DataTables::SSP::Params>.
74  
75  
76 =head1 SUPPORT
77  
78 =head2 Bugs / Feature Requests
79  
80 Please report any bugs or feature requests through the issue tracker
81 at L<https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables/issues>.
82 You will be notified automatically of any progress on your issue.
83  
84 =head2 Source Code
85  
86 This is open source software. The code repository is available for
87 public review and contribution under the terms of the license.
88  
89 L<https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables>
90  
91 git clone https://github.com/giterlizzi/perl-Mojolicious-Plugin-DataTables.git
92  
93  
94 =head1 AUTHOR
95  
96 =over 4
97  
98 =item * Giuseppe Di Terlizzi <gdt@cpan.org>
99  
100 =back
101  
102  
103 =head1 LICENSE AND COPYRIGHT
104  
105 This software is copyright (c) 2020-2021 by Giuseppe Di Terlizzi.
106  
107 This is free software; you can redistribute it and/or modify it under
108 the same terms as the Perl 5 programming language system itself.
109  
110 =cut
« DataTables/SSP/Params.pm ↑ Summary DataTables/SSP/Column.pm »