This post is part of a series which documents the vim-ruby-refactoring plugin.
Extract Constant
Extracts a selection into a constant which is placed at the top of the current module or class.
The refactoring: http://www.refactoring.com/catalog/replaceMagicNumberWithSymbolicConstant.html
Example
Before refactoring:
Visually select the value you wish to extract
Hit your **
After refactoring:
The value 9.81 has been extracted into a constant GRAVITATIONAL_CONSTANT which is placed at the top of the module.
rec is the default binding for this refactoring, think Refactor Extract Constant.