I have a couple of functions in my .vimrc for manipulating Ruby hashes.
The first one is to convert hashes from Ruby 1.8 style into Ruby 1.9+ style, eg.
I create this function for both Normal and Visual modes to allow updating either a selected hash, or the entire file.
Next, I have one for taking a hash and extracting an array of the hash keys.
Here, I have the command bound only in Visual mode, as I don’t see a case where I’d want to do this globally.
The regexes can probably be improved to fix some edge cases, and I’m certain there’s a way in Vim to make it so that I don’t have to define the All and Selected versions of RubyHashes as separate functions. But these do the job for me now, until I reach a higher plane of Vim mastery.