RubyMine
 
Get RubyMine

Extract field

Last modified: 08 October 2024

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/2024.3/rm_refactoring_extract_field.png
Gif

To extract a field: