You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be very useful to be able to constrain the return type of execute.
Ideally it can be defined in a block like so:
class GetFavToppings < ActiveInteraction::Base
returns do
string :topping_name
integer :weight
end
def execute
prepare_return do |p|
p.add(:topping_name, 'peppers')
p.add(:weight, 10)
end
end
end
The text was updated successfully, but these errors were encountered:
I am willing to continue discussing this with you, but I do not think that we will add this feature to ActiveInteraction. If you want this behavior, it is possible to use another library (like contracts.ruby) to get it done. ActiveInteraction is mostly concerned with validating inputs. It is common for interactions to have no useful return type at all.
It would be very useful to be able to constrain the return type of execute.
Ideally it can be defined in a block like so:
The text was updated successfully, but these errors were encountered: