line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
# |
2
|
|
|
|
|
|
|
# This file is part of Dancer-Plugin-Params-Normalization |
3
|
|
|
|
|
|
|
# |
4
|
|
|
|
|
|
|
# This software is copyright (c) 2011 by Damien "dams" Krotkine. |
5
|
|
|
|
|
|
|
# |
6
|
|
|
|
|
|
|
# This is free software; you can redistribute it and/or modify it under |
7
|
|
|
|
|
|
|
# the same terms as the Perl 5 programming language system itself. |
8
|
|
|
|
|
|
|
# |
9
|
|
|
|
|
|
|
package Dancer::Plugin::Params::Normalization::Abstract; |
10
|
|
|
|
|
|
|
{ |
11
|
|
|
|
|
|
|
$Dancer::Plugin::Params::Normalization::Abstract::VERSION = '0.52'; |
12
|
|
|
|
|
|
|
} |
13
|
3
|
|
|
3
|
|
740368
|
use strict; |
|
3
|
|
|
|
|
8
|
|
|
3
|
|
|
|
|
91
|
|
14
|
3
|
|
|
3
|
|
23
|
use warnings; |
|
3
|
|
|
|
|
6
|
|
|
3
|
|
|
|
|
74
|
|
15
|
|
|
|
|
|
|
|
16
|
|
|
|
|
|
|
# ABSTRACT: class for custom parameters normalization |
17
|
|
|
|
|
|
|
|
18
|
3
|
|
|
3
|
|
15
|
use base 'Dancer::Engine'; |
|
3
|
|
|
|
|
5
|
|
|
3
|
|
|
|
|
356
|
|
19
|
|
|
|
|
|
|
|
20
|
|
|
|
|
|
|
# args: ($class) |
21
|
|
|
|
|
|
|
# Overload this method in your normalization class if you have some init stuff to do, |
22
|
|
|
|
|
|
|
# such as a database connection or making sure a directory exists... |
23
|
|
|
|
|
|
|
# sub init { return 1; } |
24
|
|
|
|
|
|
|
|
25
|
|
|
|
|
|
|
# args: ($self, $hashref) |
26
|
|
|
|
|
|
|
# receives a hashref of parameters names/values. It should return a hashrefs of |
27
|
|
|
|
|
|
|
# the normalized (modified) parameters. |
28
|
|
|
|
|
|
|
sub normalize { |
29
|
0
|
|
|
0
|
1
|
|
die "retrieve not implemented"; |
30
|
|
|
|
|
|
|
} |
31
|
|
|
|
|
|
|
|
32
|
|
|
|
|
|
|
# Methods below this this line should not be overloaded. |
33
|
|
|
|
|
|
|
|
34
|
|
|
|
|
|
|
# The constructor is inherited from Dancer::Engine, itself inherited from Dancer::Object. |
35
|
|
|
|
|
|
|
|
36
|
|
|
|
|
|
|
1; |
37
|
|
|
|
|
|
|
|
38
|
|
|
|
|
|
|
__END__ |