RubyMine 2019.2 Help

Creating Ruby Files, Classes and Modules

RubyMine 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 popup, do one of the following:

    • To create a new Ruby file, enter its name and make sure that File is selected.

      New Ruby File/Class dialog
    • To create a Ruby class, switch to Class and specify the class name.

      New Ruby File/Class dialog

      RubyMine allows you to create classes prepended by modules. If required, prepend the class name with the 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 to Module and specify the module name.

    Press Enter.

Last modified: 5 August 2019