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

Extract parameter

Last modified: 09 August 2022

Refactor | Extract/Introduce | Parameter

Ctrl+Alt+F

The Extract Parameter refactoring is used to add a new parameter to a method declaration and to update the method calls accordingly.

The animation below demonstrates how to add a method parameter by extracting a value from a string:

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

To extract a parameter: