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
Example
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.
Categories: Ruby, vim
ruby vim refactoring vim-ruby-refactoring
Comments (0)