RubyMine
 
Get RubyMine
You are viewing the documentation for an earlier version of RubyMine.

Extract field

Last modified: 09 August 2022

Refactor | Extract/Introduce | Field

Ctrl+Alt+F

The Extract Field refactoring lets you extract a specified value to an instance or class variable.

The animation below demonstrates how to extract a specific word from a string to an instance variable:

https://resources.jetbrains.com/help/img/idea/2022.2/rm_refactoring_extract_field.png
Gif

To extract a field: