Stats

116 Contributors: 4 Wednesday, October 19, 2016
Licensed under: CC-BY-SA
Not affiliated with Stack Overflow
Rip Tutorial: riptutorial@gmail.com
Roadmap: roadmap
Download eBook

Modules

Download ruby eBook

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