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
Mike Nelson edited this page Jan 29, 2020
·
1 revision
The Subroutine::Op class' submit and submit! methods have identical signatures to the class' constructor, enabling a few different ways to utilize an op:
Via the class' submit method
op=MyOp.submit({foo: 'bar'})# if the op succeeds it will be returned, otherwise false will be returned.
Via the class' submit! method
op=MyOp.submit!({foo: 'bar'})# if the op succeeds it will be returned, otherwise a ::Subroutine::Failure will be raised.
Via the instance's submit method
op=MyOp.new({foo: 'bar'})val=op.submit# if the op succeeds, val will be true, otherwise false
Via the instance's submit! method
op=MyOp.new({foo: 'bar'})op.submit!# if the op succeeds nothing will be raised, otherwise a ::Subroutine::Failure will be raised.