diff Lib/IMPL/Transform.pm @ 7:94d47b388442

Улучшены тесты Исправлены ошибки Улучшена документация Работа над схемой DOM
author Sergey
date Mon, 24 Aug 2009 01:05:34 +0400
parents 03e58a454b20
children d660fb38b7cc
line wrap: on
line diff
--- a/Lib/IMPL/Transform.pm	Fri Aug 14 16:14:13 2009 +0400
+++ b/Lib/IMPL/Transform.pm	Mon Aug 24 01:05:34 2009 +0400
@@ -1,5 +1,5 @@
 package IMPL::Transform;
-use base qw(IMPL::Object IMPL::Object::Autofill);
+use base qw(IMPL::Object);
 
 use IMPL::Class::Property;
 use IMPL::Class::Property::Direct;
@@ -10,7 +10,14 @@
     protected _direct property Plain => prop_all;
 }
 
-__PACKAGE__->PassThroughArgs;
+sub CTOR {
+    my ($this,%args) = @_;
+    
+    $this->{$Plain} = delete $args{-plain};
+    $this->{$Default} = delete $args{-default};
+    
+    $this->{$Templates} = \%args;
+}
 
 sub Transform {
     my ($this,$object) = @_;
@@ -56,9 +63,19 @@
     DocClass => sub {
         my ($this,$object) = @_;
         return new DocPreview(Author => $object->Author, Text => $object->Data);
+    },
+    -default => sub {
+        my ($this,$object) = @_;
+        return $object;
+    },
+    -plain => sub {
+        my ($this,$object) = @_;
+        return $object;
     }
 );
 
+my $result = $t->Transform($obj);
+
 =head1 Summary
           .