|
@@ -1,37 +0,0 @@
|
1
|
|
-package SugarTrail::Template::CondBlock;
|
2
|
|
-# condition block
|
3
|
|
-# init()
|
4
|
|
-# parse(string)
|
5
|
|
-# matches(data)
|
6
|
|
-
|
7
|
|
-use strict;
|
8
|
|
-use warnings;
|
9
|
|
-
|
10
|
|
-use SugarTrail::Template::Condition;
|
11
|
|
-use Data::Dumper;
|
12
|
|
-
|
13
|
|
-sub init {
|
14
|
|
- my $class = shift;
|
15
|
|
- my $self = {};
|
16
|
|
- return bless $self, $class;
|
17
|
|
-}
|
18
|
|
-
|
19
|
|
-sub parse {
|
20
|
|
- my $self = shift;
|
21
|
|
- my $string = shift;
|
22
|
|
- my @parts = split ";", $string;
|
23
|
|
- foreach (@parts) {
|
24
|
|
- my $c = SugarTrail::Template::Condition->new($_);
|
25
|
|
- push @{$self->{conds}}, $c;
|
26
|
|
- }
|
27
|
|
- return scalar @{ $self->{conds} };
|
28
|
|
-}
|
29
|
|
-
|
30
|
|
-
|
31
|
|
-
|
32
|
|
-sub match {
|
33
|
|
- my $self = shift;
|
34
|
|
- my $args = shift;
|
35
|
|
-}
|
36
|
|
-
|
37
|
|
-1;
|