RubyMine
 
Get RubyMine

Extract parameter

Last modified: 08 October 2024

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

To extract a parameter: