# Inline

> For the complete documentation index, see [llms.txt](https://www.jetbrains.com/help/ruby/2026.3/llms.txt).

> **TL;DR**
> `Refactor | Inline`
>
>
>
> `Ctrl+Alt+N` (Windows), `⌘ ⌥ N` (macOS), `⌘ ⌥ N` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ N` (macOS System Shortcuts), `Ctrl+Alt+N` (XWin), `Ctrl+Alt+N` (GNOME), `Ctrl+Alt+N` (KDE), `Ctrl+Alt+N` (Emacs), `Ctrl+Alt+N` (Sublime Text), `⌘ ⌥ N` (Sublime Text (macOS)), `Ctrl+R, I` (Visual Studio), `⌘ R, I` (Visual Studio (macOS)), `Meta+Alt+N` (TextMate), `Ctrl+Alt+N` (NetBeans), `Alt+Shift+I` (Eclipse), `⌘ ⌥ I` (Eclipse (macOS))

Currently, RubyMine provides the Inline Function refactoring, which is opposite to the [Extract method](extract-method.html) refactoring.

The Inline refactoring lets you reverse the extract refactoring for variables and methods.

The animation below demonstrates how to inline a variable to a string:

![inline variable](https://resources.jetbrains.com/help/img/idea/2026.3/rm_refactoring_inline_variable.animated.gif)

To inline a variable/method:

Procedure:

1. Place a caret at the variable/method name.

2. Press `Ctrl+Alt+N` (Windows), `⌘ ⌥ N` (macOS), `⌘ ⌥ N` (IntelliJ IDEA Classic (macOS)), `⌘ ⌥ N` (macOS System Shortcuts), `Ctrl+Alt+N` (XWin), `Ctrl+Alt+N` (GNOME), `Ctrl+Alt+N` (KDE), `Ctrl+Alt+N` (Emacs), `Ctrl+Alt+N` (Sublime Text), `⌘ ⌥ N` (Sublime Text (macOS)), `Ctrl+R, I` (Visual Studio), `⌘ R, I` (Visual Studio (macOS)), `Meta+Alt+N` (TextMate), `Ctrl+Alt+N` (NetBeans), `Alt+Shift+I` (Eclipse), `⌘ ⌥ I` (Eclipse (macOS)) or go to `Refactor | Inline` in the main menu.

3. In the Inline dialog that corresponds to the selected variable or method, specify the inlining options. Preview and apply changes.

## Inline Variable

The Inline Variable refactoring replaces redundant variable usage with its initializer. This refactoring is opposite to [Extract Variable](extract-variable.html).

| Before | After |
| --- | --- |
|     ```RUBY name = "JetBrains" puts "Hello from #{name}" ```    |     ```RUBY puts "Hello from JetBrains" ```    |

## Inline Method

Inline Method results in placing method's body into the body of its caller(s).

| Before | After |
| --- | --- |
|     ```RUBY def test   c=add(a,b)   d=add(a,c) end  def add(a, b)   a+b end ```    |     ```RUBY def test   c = a + b   d = a + c end ```    |

## See also

### Procedures

[Refactor code](refactoring-source-code.html)

### Procedures

[Extract/Introduce variable](extract-variable.html)   [Extracting variables in Style Sheets](null)

### External Links

[Inline method](http://blog.jetbrains.com/ruby/2012/01/whats-mining-inline-method-refactoring/)

