diff lib/IMPL/Config/Container.pm @ 417:3ed0c58e9da3 ref20150831

working on di container, tests
author cin
date Mon, 02 Nov 2015 01:56:53 +0300
parents 3d24b10dd0d5
children 3f38dabaf5cc
line wrap: on
line diff
--- a/lib/IMPL/Config/Container.pm	Thu Oct 29 03:50:25 2015 +0300
+++ b/lib/IMPL/Config/Container.pm	Mon Nov 02 01:56:53 2015 +0300
@@ -47,6 +47,12 @@
 	}
 }
 
+sub Require {
+	my ($this, $class) = @_;
+	
+	return $this->loader->Require($class);
+}
+
 sub Register {
 	my ( $this, $role, $service ) = @_;
 
@@ -64,7 +70,7 @@
 
 	if ( isarray($role) ) {
 		my $tempRole = "unnamed-" . $nextRoleId++;
-		$this->role->AddRole( $tempRole, $role );
+		$this->roles->AddRole( $tempRole, $role );
 		$role = $tempRole;
 	}
 
@@ -77,7 +83,7 @@
 	my $descriptor = $this->services->Resolve($role);
 
 	return $descriptor->Activate( ActivationContext->new($this) )
-	  if $descirptor;
+	  if $descriptor;
 
 	return $opts{default} if exists $opts{default};
 }