Refactor local to member variable? (RubyMine 3.0)
Is there a way to refactor a local variable to a member variable (other than search+replace.) For example:
foo = 'bar'
puts foo
Becomes
@foo = 'bar'
puts @foo
My first thought was Rename, but that refactoring prevents @ in a name.
If there's not, I'd like to request it as a feature: would the tracker at http://youtrack.jetbrains.net/issues/RUBY be the correct place for a feature request?
Please sign in to leave a comment.
Hello Yuri,
You can try using introduce field refactoring for this purpose, however it won't do exactly what you want here.
Yep, this is the correct place, but please use search to ensure that this feature is not submitted yet. If it is, just vote for it to let us know that you are among those who want to have it implemented.
Regards,
Oleg