Created
August 27, 2013 16:22
-
-
Save ashleytbasinger/e6ba5c837988a9267696 to your computer and use it in GitHub Desktop.
mailing list
This file contains 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
salutations = [ | |
'Mr.', | |
'Mrs.', | |
'Mr.', | |
'Dr.', | |
'Ms.' | |
] | |
first_names = [ | |
'John', | |
'Jane', | |
'Sam', | |
'Louise', | |
'Kyle' | |
] | |
last_names = [ | |
'Dillinger', | |
'Cook', | |
'Livingston', | |
'Levinger', | |
'Merlotte' | |
] | |
addresses = [ | |
'33 Foolish Lane, Boston MA 02210', | |
'45 Cottage Way, Dartmouth, MA 02342', | |
"54 Sally's Court, Bridgewater, MA 02324", | |
'4534 Broadway, Boston, MA 02110', | |
'4231 Cynthia Drive, Raynham, MA 02767' | |
] | |
address_list = [] | |
salutations.each do | salutation, index| | |
address_hash = {} | |
address_hash[:salutation] = salutation | |
address_hash[:first_name] = first_names[index] | |
address_hash[:last_name] = last_names[index] | |
address_hash[:addresses] = addresses[index] | |
address_list.push(address_hash) | |
end | |
address_list.each do |address| | |
puts "#{address[:salutation]} #{address[:first_name]}" + | |
address[:last_name] | |
puts address[:address] | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment