collectiveidea / interactor

Interactor provides a common interface for performing complex user interactions.
MIT License
3.36k stars 212 forks source link

How know the class name of the interactor that it was executed after returns the context? #182

Open memoxmrdl opened 4 years ago

memoxmrdl commented 4 years ago

For example:

> result = PlaceOrder.call
> result.class 
> Interactor::Context # I expect that it returns PlaceOrder but really it's the context
sunny commented 4 years ago

I don't think it would make sense for it to return PlaceOrder, since it must return a context.

Should you want to know the name of the interactor after calling it you can always do something like:

interactor = PlaceOrder
interactor.call
interactor.class
# => PlaceOrder