How do you create a module in Ruby?
Christopher Davis
Updated on May 05, 2026
Creating Modules in Ruby
To define a module, use the module keyword, give it a name and then finish with an end . The module name follows the same rules as class names. The name is a constant and should start with a capital letter. If the module is two words it should be camel case (e.g MyModule).