File Coverage

blib/lib/Template/Liquid/Tag/Decrement.pm
Criterion Covered Total %
statement 12 13 92.3
branch n/a
condition n/a
subroutine 6 7 85.7
pod n/a
total 18 20 90.0


line stmt bran cond sub pod time code
1             package Template::Liquid::Tag::Decrement;
2             our $VERSION = '1.0.23';
3 25     25   182 use strict;
  25         52  
  25         781  
4 25     25   125 use warnings;
  25         52  
  25         911  
5             require Template::Liquid::Error;
6             require Template::Liquid::Utility;
7 25     25   134 use base 'Template::Liquid::Tag::Increment';
  25         75  
  25         12878  
8 25     25   105 sub import { Template::Liquid::register_tag('decrement') }
9             #
10 2     2   14 sub _initial {-1}
11 2     2   10 sub _direction {-1}
12 0     0     sub _me {'decrement'}
13             1;
14              
15             =pod
16              
17             =encoding UTF-8
18              
19             =begin stopwords
20              
21             Lütke jadedPixel
22              
23             =end stopwords
24              
25             =head1 NAME
26              
27             Template::Liquid::Tag::Decrement - Document-level Persistant Number
28              
29             =head1 Description
30              
31             Creates a new number variable, and decreases its value by one every time it is
32             called. The initial value is C<-1>.
33              
34             =head1 Synopsis
35              
36             {% decrement my_counter %}
37             {% decrement my_counter %}
38             {% decrement my_counter %}
39              
40             ...will result in...
41              
42             -1
43             -2
44             -3
45              
46             =head1 Notes
47              
48             Like C<increment>, variables declared inside C<decrement> are independent from
49             variables created through C<assign> or C<capture>.
50              
51             =head1 See Also
52              
53             Liquid for Designers: http://wiki.github.com/tobi/liquid/liquid-for-designers
54              
55             =head1 Author
56              
57             Sanko Robinson <sanko@cpan.org> - http://sankorobinson.com/
58              
59             The original Liquid template system was developed by jadedPixel
60             (http://jadedpixel.com/) and Tobias Lütke (http://blog.leetsoft.com/).
61              
62             =head1 License and Legal
63              
64             Copyright (C) 2009-2022 by Sanko Robinson E<lt>sanko@cpan.orgE<gt>
65              
66             This program is free software; you can redistribute it and/or modify it under
67             the terms of The Artistic License 2.0. See the F<LICENSE> file included with
68             this distribution or http://www.perlfoundation.org/artistic_license_2_0. For
69             clarification, see http://www.perlfoundation.org/artistic_2_0_notes.
70              
71             When separated from the distribution, all original POD documentation is covered
72             by the Creative Commons Attribution-Share Alike 3.0 License. See
73             http://creativecommons.org/licenses/by-sa/3.0/us/legalcode. For clarification,
74             see http://creativecommons.org/licenses/by-sa/3.0/us/.
75              
76             =cut