collectiveidea/interactor — pull request #32 by spoptchev (2014-03-06 09:24:30+00:00)
Title: Interactor registry

I like the idea of the interactors but for me as a developer it does not feel right to use a class name as an "interface" for something that essentially should be a method. So instead of `UserLogin.perform` I want to call a method `user_login`.

Here is the idea of the registry:

```ruby
registry = Interactor.registry
registry.user_login(email, password)
```
Use of dot notation for namespaces:

```ruby
module User
class Login
include Interactor
end
class Register
include Interactor
end
module Admin
class DeleteUser
include Interactor
end
end
end

registry = Interactor.registry
registry.user.login # instead of User::Login.perform
registry.user.register # instead of User::Register.perform
registry.user.admin.delete_user # instead of User::Admin::DeleteUser.perform
```
You also have better control of indentation which makes your code more readable:

```ruby
module User
module LongNamespaceName
class DoSomethingWithAVeryLongName
include Interactor
end
end
end

# without registry
User::LongNamespaceName::DoSomethingWithAVeryLongName.perform

# with registry
registry.user.long_namespace_name.
do_something_with_a_very_long_name
```