You're looking for a concept called: "overloading",
I'm not so familiar with the active-interaction gem, but in statically typed languages such as C#, Java, etc... You can use overloading.
How can it help?
For example, if you have a route called "send-details" that can accept a string/int.
You can do something like (C# for the example):
[HttpPost]
public void doSomething(String param)
{
BL.doSomething()
}
[HttpPost]
public void doSomething(int param)
{
BL.doSomething()
}
Now, we overloaded the doSomething
function and the route will match the correct one, keeping it DRY and OOP friendly.
From the docs, it looks very weird the way active-interaction behaves, because ruby is a dynamically-typed language, and active-interaction uses a filter to make it statically typed.
I believe your best option will be:
Move all BL to a separate Service, and create 2 interactions with different params (the signature) => in both just call the newly created service.
Yes, it's a lot of code, but I believe it will be your best resolution for the situation.
On a personal note, I would not use active interaction for production products due to lack of community and the fact it goes against ruby standards.
you can read more about overloading here: https://en.wikipedia.org/wiki/Function_overloading