Created
September 18, 2012 04:18
-
-
Save mvrilo/3741241 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # separating emails by the host | |
| hash = {} | |
| %w{ [email protected] [email protected] }.each do |mail| | |
| id, host = mail.split("@") | |
| hash[host] ||= [] | |
| hash[host] << id | |
| end | |
| # >> hash | |
| # => {"gmail.com"=>["mvrilo", "mvrilo+test"]} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment