diff lib/IMPL/Config/Descriptor.pm @ 421:7798345304bc ref20150831

working on IMPL::Config, removed old stuff
author cin
date Sun, 16 Jul 2017 22:59:39 +0300
parents df591e3afd10
children b0481c071bea
line wrap: on
line diff
--- a/lib/IMPL/Config/Descriptor.pm	Sat Feb 25 22:35:26 2017 +0300
+++ b/lib/IMPL/Config/Descriptor.pm	Sun Jul 16 22:59:39 2017 +0300
@@ -10,39 +10,39 @@
 sub ACTIVATE_CALL()      { 5 }
 
 my %activateNames = (
-	singleton => ACTIVATE_SINGLETON,
-	container => ACTIVATE_CONTAINER,
-	hierarchy => ACTIVATE_HIERARCHY,
-	context   => ACTIVATE_CONTEXT,
-	call      => ACTIVATE_CALL
+    singleton => ACTIVATE_SINGLETON,
+    container => ACTIVATE_CONTAINER,
+    hierarchy => ACTIVATE_HIERARCHY,
+    context   => ACTIVATE_CONTEXT,
+    call      => ACTIVATE_CALL
 );
 
-my %activateNamesLookup = map { $activateNames{$_}, $_ } keys %activateNames;
+my %activateNamesLookup = reverse %activateNames;
 
 sub Activate {
-	my ( $this, $context ) = @_;
-	die IMPL::NotImplementedException->new();
+    my ( $this, $context ) = @_;
+    die IMPL::NotImplementedException->new();
 }
 
 sub ParseActivation {
-	my $val = pop @_;
+    my $val = pop @_;
 
-	return ACTIVATE_CALL unless $val;
+    return ACTIVATE_CALL unless $val;
 
-	return grep $_ == $val,
-	  ACTIVATE_SINGLETON,
-	  ACTIVATE_CONTAINER,
-	  ACTIVATE_HIERARCHY,
-	  ACTIVATE_CONTEXT, ACTIVATE_CALL ? $val : ACTIVATE_CALL
-	  if looks_like_number($val);
+    return grep( $_ == $val,
+        ACTIVATE_SINGLETON,
+        ACTIVATE_CONTAINER,
+        ACTIVATE_HIERARCHY,
+        ACTIVATE_CONTEXT, ACTIVATE_CALL ) ? $val : ACTIVATE_CALL
+      if looks_like_number($val);
 
-	return $activateNames{ lc($val) } || ACTIVATE_CALL;
+    return $activateNames{ lc($val) } || ACTIVATE_CALL;
 }
 
 sub ActivationToString {
-	my $val = pop @_;
+    my $val = pop @_;
 
-	return ( $val && $activateNamesLookup{$val} ) || '';
+    return ( $val && $activateNamesLookup{$val} ) || '';
 }
 
 1;