Given Signal is in great part a client side app, there is definitely an API, and you will almost certainly be able to reverse engineer it from the source code.
But as they say, use outside of Signal is “unsupported”, so whilst you might get help from their community, there would be no guarantee of stability of this interface or the libraries you might need to rely upon in the RoR universe.
There will undoubtedly be other attempts in various ecosystems sitting on several GitHub repos that may no longer be maintained and no longer work but provide some insights.
You would have to be able to link each Discourse user account with each corresponding Signal accounts in a similar fashion as the current scheme and maintain local private keys for each User, decrypt the messages and then process them.
It’s definitely feasible, but an unpredictably large amount of ongoing work, not least because you are without a document for the API that was never meant to be consumed by Ruby on Rails (but you never know).
I suspect you are going to need to want this very badly to get it done.
, unless you can inspire someone to pick this up as a passion project.