Skip to content

Instantly share code, notes, and snippets.

@sllvn
Created April 29, 2012 23:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save sllvn/2554014 to your computer and use it in GitHub Desktop.
Save sllvn/2554014 to your computer and use it in GitHub Desktop.
Create a hash with keys set in array
keys = %w[event event_id event_type name description date]
Hash[*keys.map { |v| [v.to_sym, nil] }.flatten]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment