IntelliJ IDEA 2019.1 Help

Creating Ruby Class

IntelliJ IDEA enables you to create empty Ruby files or generate classes and modules. To create a new Ruby file, class, or module, do the following:

  1. In the Project tool window, select the directory where you want a class to be created, and press Alt+Insert.

  2. From the popup menu, select Ruby File/Class.

  3. In the New Ruby File/Class dialog, do one of the following:

    • To create a new Ruby file, enter its name in the Name field.

      New Ruby File/Class dialog
    • To create a Ruby class, switch the Kind option to Class and specify the class name in the Name field.

      New Ruby File/Class dialog

      IntelliJ IDEA allows you to create classes prepended by modules. If required, prepend the class name with module name:

      New Ruby File/Class dialog

      In this case, the created file will look as follows:

      New class
    • To create a Ruby module, switch the Kind option to Module and specify the module name in the Name field.

    Click OK.

Last modified: 20 June 2019