I recently discovered that I can do similar things in Kotlin. And, the nice thing about that is that I actually know Kotlin in contrast to Ruby, which I have a rather surface familiarity with. Leading me to having to constantly Google things like "how do I x in Ruby". Kotlin + some extension functions can be very cozy