just ram

stuff I should remember

vim-ruby-refactoring - Inline Temp

This post is part of a series which documents the vim-ruby-refactoring plugin.

Inline Temp

Replaces a temporary variable with a direct call to the method or formula.

The refactoring: http://www.refactoring.com/catalog/inlineTemp.html


Before refactoring:

Move the cursor onto the temp variable (in this case base_price)
Hit your **** then type **rit **

After refactoring:

The temp variable base_price has been replace with a direct call to the method and we’ve saved a line of code.

rit is the default binding for this refactoring, think Refactor Inline Temp.