diff Lib/IMPL/Class/Meta.pm @ 230:6d8092d8ce1b

*reworked IMPL::Security *reworked IMPL::Web::Security *refactoring
author sergey
date Mon, 08 Oct 2012 03:37:37 +0400
parents 47f77e6409f7
children 0f59b2de72af
line wrap: on
line diff
--- a/Lib/IMPL/Class/Meta.pm	Sat Sep 29 02:34:47 2012 +0400
+++ b/Lib/IMPL/Class/Meta.pm	Mon Oct 08 03:37:37 2012 +0400
@@ -87,19 +87,21 @@
     *{"${class}::${name}"} = sub {
     	my $self = shift;
     	
+    	$self = ref $self || $self;
+    	
         if (@_ > 0) {            
-            $self = ref $self || $self;            
-            
             if ($class ne $self) {
                 $self->static_accessor_clone( $name => $_[0] ); # define own class data
             } else {
                 $value = $_[0];
             }
         } else {
-        	$self->static_accessor_clone($name => clone($value));
+        	return $self ne $class
+        	   ? $self->static_accessor_clone($name => clone($value))
+        	   : $value;
         }
     };
-    $value
+    return $value;
 };
 
 sub static_accessor_inherit {
@@ -121,7 +123,8 @@
         } else {
             $value ;
         }        
-    }
+    };
+    return $value;
 }
 
 sub static_accessor_own {
@@ -145,7 +148,9 @@
                 return $value;
             }
         }    
-    }
+    };
+    
+    return $value;
 }
 
 sub _find_class_data {