interactor-contracts icon indicating copy to clipboard operation
interactor-contracts copied to clipboard

Add contracts to your interactors

Results 6 interactor-contracts issues
Sort by recently updated
recently updated
newest added

My original vision for this gem was to build a way to validate that the the interactors that you compose with [organizers](https://github.com/collectiveidea/interactor/#organizers) form a valid chain of business logic. When...

enhancement
help wanted
hacktoberfest
newcomers welcome

No superclass, `on_breach` is called: ```ruby module Api module V2 class FetchThreedsParams include Interactor include Interactor::Contracts expects do required(:user).filled end on_breach do |breaches| puts '1'*30 end before do end def...

Using this gem in a Rails project, I wrote the following: ```ruby class EnqueueMessagingJob include Interactor include Interactor::Contracts expects do required(:conversation).schema do required(:type).filled(included_in?: %w[email sms]) # ... end end def...

I'd like to ensure my Interator fills in an Array with a size based on an attribute from the `context`: ```ruby promises do required(:users).filled(min_size?: context.user_ids.size) end ``` But that's not...

Is it possible to set default values? I would like to set certain constraints on incoming parameters while not requiring to fill in any of them, falling back to defaults...

documentation
hacktoberfest

Rather than add a bunch of boilerplate tests for contract breaches, I was wondering if there was something similar to the `shoulda-matchers`. https://github.com/thoughtbot/shoulda-matchers/tree/main So for ````ruby class MyInteractor include Interactor...