collectiveidea / interactor

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

Add Optional Context Contract / Verification capability #204

Closed sufyanadam closed 2 years ago

sufyanadam commented 2 years ago

Add a needs_context :key1, :key2, :key3... method to support basic context contract verification / checking.

By including the ContextValidation module in your interactor class, you get to declare what items in the context are actually required for the interactor to work correctly.

If someone tries to use an interactor without passing it any one of the required items, an error is raised.