README.md in habu-0.1.1 vs README.md in habu-0.2.0
- old
+ new
@@ -53,9 +53,18 @@
container = Habu::Container.new
# Register user_repository service by passing the block as service factory
container[:user_repository] { User }
+# You can access to registered service by calling the method of Container#factory
+container.factory.user_repository.new("hanachin")
+# => #<struct User name="hanachin">
+
+# Also you can use Container#factory as refinements for shorthand
+using container.factory.to_refinements
+user_repository.new("hanachin")
+# => #<struct User name="hanachin">
+
# Call Habu::Container#new to get instance
new_user = container.new(NewUserService).call("hanachin")
# => #<struct User name="hanachin">
# Factory block take a container as argument