Home > Ruby, vim > vim-ruby-refactoring – Inline Temp

vim-ruby-refactoring – Inline Temp

30 December, 2010

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 <leader-key> 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.

  1. No comments yet.
  1. 30 December, 2010 at 9:40 pm
Comments are closed.
%d bloggers like this: