[Bps-public-commit] r17414 - in Path-Dispatcher/trunk: lib/Path/Dispatcher/Rule

sartak at bestpractical.com sartak at bestpractical.com
Mon Dec 29 20:36:43 EST 2008


Author: sartak
Date: Mon Dec 29 20:36:42 2008
New Revision: 17414

Modified:
   Path-Dispatcher/trunk/   (props changed)
   Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm

Log:
 r78041 at onn:  sartak | 2008-12-29 20:36:39 -0500
 Tokens' readable_attributes


Modified: Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm
==============================================================================
--- Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	(original)
+++ Path-Dispatcher/trunk/lib/Path/Dispatcher/Rule/Tokens.pm	Mon Dec 29 20:36:42 2008
@@ -122,6 +122,28 @@
 }
 
 sub readable_attributes {
+    my $self = shift;
+
+    my $deserialize;
+    $deserialize = sub {
+        my $ret = '';
+        for (my $i = 0; $i < @_; ++$i) {
+            local $_ = $_[$i];
+
+            if (ref($_) eq 'ARRAY') {
+                $ret .= $deserialize->(@$_);
+            }
+            else {
+                $ret .= $_;
+            }
+
+            $ret .= ',' if $i + 1 < @_;
+        }
+
+        return "[" . $ret . "]";
+    };
+
+    return $deserialize->($self->tokens);
 }
 
 after trace => sub {



More information about the Bps-public-commit mailing list