module functions in Ruby
by Syed Aslam · 2 min read
In Ruby we can create module functions for named methods that may be called with the module as a receiver, and these functions also become available as instance methods to classes that mix in the module. There are multiple techniques to achieve this in Ruby, but the simplest and best known are Module#module_function and extend self.