Ruby LanguageModules

Download Ruby Language for free

Syntax

  • Declaration

    module Name;
    
        any ruby expressions;
    
    end
    

Remarks

Module names in Ruby are constants, so they have to start with a capital letter.

module foo; end # Syntax error: class/module name must be CONSTANT

Related Examples

A simple mixin with extend