Skip to content

Commit

Permalink
Fix README
Browse files Browse the repository at this point in the history
  • Loading branch information
Marcelo Jacobus committed Apr 25, 2017
1 parent 0b778bc commit b713286
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ dependency_manager.share(:connection) do |dependency_manager|
MyConnection.new("mysql://root@localhost/my_db")
end

dependency_manager.share(UserRepository) do |dependency_manager|
dependency_manager.share(:user_repository) do |dependency_manager|
connection = dependency_manager.get(:connection)
UserRepository.new(connection)
end
Expand All @@ -65,11 +65,13 @@ class UsersController < SomeBaseController
private

def repository
dependency_manager.get(UserRepository)
dependency_manager.get(:user_repository)
end
end
```

### Using factories

```ruby
class DatabaseConnectionFactory < Nurse::SharedServiceFactory
def create_service(dependencies)
Expand All @@ -95,8 +97,6 @@ dependency_manager.add_factory(DatabaseConnectionFactory.new)
dependency_manager.add_factory(UserRepositoryFactory.new)
```

### Using factories

## Development

After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake test` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
Expand Down

0 comments on commit b713286

Please sign in to comment.