diff Lib/IMPL/Transform.pm @ 198:2ffe6f661605

Implemented IMPL::Web::Handler::RestController fixes in IMPL::Serialization completed IMPL::Web::Application::RestResource added IMPL::Web::Handler::JSONView added IMPL::Web::RestContract
author cin
date Fri, 20 Apr 2012 16:06:36 +0400
parents 6b1dda998839
children e743a8481327
line wrap: on
line diff
--- a/Lib/IMPL/Transform.pm	Thu Apr 19 02:10:02 2012 +0400
+++ b/Lib/IMPL/Transform.pm	Fri Apr 20 16:06:36 2012 +0400
@@ -15,12 +15,13 @@
 }
 
 sub CTOR {
-    my ($this,%args) = @_;
+    my $this = shift;
+    my $args = @_ == 1 ? shift : { @_ };
     
-    $this->{$plain} = delete $args{-plain};
-    $this->{$default} = delete $args{-default};
+    $this->{$plain} = delete $args->{-plain};
+    $this->{$default} = delete $args->{-default};
     
-    $this->{$templates} = \%args;
+    $this->{$templates} = $args;
 }
 
 sub Transform {
@@ -59,6 +60,7 @@
             	
             	$t = $this->{$templates}->{$sclass};
             	
+            	#cache and return
             	return $this->{$_cache}->{$class} = $t if $t;
             	
             	push @isa, @{"${sclass}::ISA"};