瀏覽代碼

Added new operator handler

Alois Mahdal 12 年之前
父節點
當前提交
ce94e72d7d
共有 1 個檔案被更改,包括 6 行新增0 行删除
  1. 6
    0
      lib/SugarTrail/Template/Condition.pm

+ 6
- 0
lib/SugarTrail/Template/Condition.pm 查看文件

@@ -19,6 +19,12 @@ sub _regex {
19 19
     return $a =~ m/$b/;
20 20
 }
21 21
 
22
+sub _in {
23
+    my $a = shift;
24
+    my %b = map { $_ => 1 } @_;
25
+    return exists $b{$a};
26
+}
27
+
22 28
 sub new {
23 29
     my $class   = shift;
24 30
     my $self    = {};