Skip to content

Instantly share code, notes, and snippets.

@hideo55
Created July 18, 2012 08:30
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 hideo55/3135049 to your computer and use it in GitHub Desktop.
Save hideo55/3135049 to your computer and use it in GitHub Desktop.
a = Hash[ *(<<EOS.split("\n").map {|e| [e,true]}.flatten()) ]
foo
bar
baz
EOS
p a # => {"foo"=>true, "bar"=>true, "baz"=>true}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment