Closed jpslav closed 9 years ago
@Dantemss and @joemsak, please take a look
Cool PR but maybe it needs some of https://github.com/openstax/exchange/blob/master/lib/lev/delegator.rb?
The Exchange stuff allows you to delegate to different routines based on the class of the first argument.
:+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses: :+1: :sunglasses:
@Dantemss if you have ideas on how to add that delegator stuff in with a tweak so that the formats are similar, I'd potentially be up for it (maybe in a separate PR written by you :-), e.g.
delegates_to: FooRoutine, for_args: Type1, Type2
or something...
would like it to not just be the first arg (that seems like it might not be that easy to know / read)
From the new README in this PR:
Delegates
If you have
you might have a reason to wrap this routine inside another, in which case you could write:
or if you use the
delegates_to:
shortcut, you can instead equivalently wrapBarRoutine
with:When using
delegates_to
, anyexpress_output
value set in the delegated routine is automatically used again by the delegating routine.