just ram

stuff I should remember

vim-ruby-refactoring - Extract to Let

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

Extract to Let

This is an RSpec specific refactoring which will extract an initialisation line and create a let method for you.


Before refactoring:
Move the cursor on to the line you wish to extract
Hit your **** then type **rel **

After refactoring:
The let method is created above the it block, using the initialisation line - account = Account.new.

rel is the default binding for this refactoring, think Refactor Extract Let.