diff Lib/IMPL/declare.pm @ 256:32aceba4ee6d

corrected ViewHandlers to handle cookies and headers. Dirty hacks to handle binary data RestController doesn't deal with file extensions anymore.
author sergey
date Wed, 12 Dec 2012 04:29:50 +0400
parents 34a3f8668b58
children 6253872024a4
line wrap: on
line diff
--- a/Lib/IMPL/declare.pm	Fri Dec 07 16:58:19 2012 +0400
+++ b/Lib/IMPL/declare.pm	Wed Dec 12 04:29:50 2012 +0400
@@ -89,27 +89,37 @@
 	  unless scalar(@$props) % 2 == 0;
 
 	if (@$props) {
-		for ( my $i = 0 ; $i < @$props - 1 ; $i = $i + 2 ) {
-			my ( $prop, $spec ) = @{$props}[ $i, $i + 1 ];
-
-			my $propInfo = IMPL::Class::PropertyInfo->new(
-				{
-					Name     => $prop,
-					Mutators => $spec,
-					Class    => $caller,
-					Access   => $prop =~ /^_/
-					? ACCESS_PRIVATE
-					: ACCESS_PUBLIC
-				}
-			);
-			$propInfo->Implement();
-		}
+	   	$self->_implementProps($props,$caller);
 	}
 	
+    if ($args->{_implement}) {
+        $self->_implementProps($caller->abstractProps,$caller);     
+    }	
+	
 	$IMPL::require::level--;
 	delete $IMPL::require::PENDING{$caller};
 }
 
+sub _implementProps {
+    my ($self, $props, $caller) = @_;
+    
+    for ( my $i = 0 ; $i < @$props - 1 ; $i = $i + 2 ) {
+        my ( $prop, $spec ) = @{$props}[ $i, $i + 1 ];
+
+        my $propInfo = IMPL::Class::PropertyInfo->new(
+            {
+                Name     => $prop,
+                Mutators => $spec,
+                Class    => $caller,
+                Access   => $prop =~ /^_/
+                ? ACCESS_PRIVATE
+                : ACCESS_PUBLIC
+            }
+        );
+        $propInfo->Implement();
+    }
+}
+
 1;
 
 __END__