Permalink
Browse files

Make resolve() take a positional param

  • Loading branch information...
1 parent 03be070 commit cd540fc3635e62036a230b73bd04a30cc96aa29b @tadzik committed Aug 25, 2011
Showing with 4 additions and 4 deletions.
  1. +1 −1 lib/IoC.pm6
  2. +2 −2 lib/IoC/Container.pm6
  3. +1 −1 t/01-basic.t
View
@@ -92,7 +92,7 @@ IoC - Wire your application components together using inversion of control
};
- my $app = $c.resolve(service => 'app');
+ my $app = $c.resolve('app');
$app.run();
=head1 DESCRIPTION
@@ -13,7 +13,7 @@ class IoC::Container {
return %!services{$service-name};
}
- method resolve(:$service) {
+ method resolve($service) {
return self.fetch($service).get;
}
};
@@ -83,7 +83,7 @@ Adds a service (L<IoC::Service> object) to your container
Returns the service provided by the string.
-=item resolve(service => '<service>')
+=item resolve('<service>')
Returns the object the service generates (equivalent to C<fetch('<service>').get()>)
View
@@ -45,7 +45,7 @@ $c.add-service(
ok($c.fetch('foo').get);
ok($c.fetch('bar').get);
-ok($c.resolve(service => 'foo'));
+ok($c.resolve('foo'));
ok($c.fetch('foo').get.bar);

0 comments on commit cd540fc

Please sign in to comment.