Skip to content

Instantly share code, notes, and snippets.

@supernullset
Created July 19, 2013 23:18
Show Gist options
  • Save supernullset/6043060 to your computer and use it in GitHub Desktop.
Save supernullset/6043060 to your computer and use it in GitHub Desktop.
(defun assign-group-from-hash (hash keys)
"creates a series of instance variable assignments in the style @key = hash.fetch(:key)"
(interactive "sHash Name: \nsKeys(separated by a space): ")
(let ((hash-keys (split-string keys)))
(mapc (lambda (key) (insert (format "@%s = %s.fetch(:%s)\n" key hash key))) hash-keys)
)
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment