You may enjoy using Contracts and the Dry-rb suite. It makes ruby behave in a more functional way without sacrificing the extreme flexibility that is inherit in the language.
There was a good blog post about this from Thomas Reynolds the developer of Middleman a little while ago[0]
[0] https://awardwinningfjords.com/2015/03/03/my-weird-ruby.html