Created
August 7, 2014 14:52
-
-
Save jshawl/06f1f3f6440d7d79d5a4 to your computer and use it in GitHub Desktop.
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
users = [ | |
'Jesse', | |
'Sean', | |
'Mikael' | |
] | |
#p users[2] | |
#p users | |
#users[0] = "Adam" | |
# users << " Regina" | |
# p users | |
# for user in users | |
# puts "Welcome, #{user}" | |
# if user == "Sean" # email preferences off | |
# next #break | |
# end | |
# puts "Sending #{user} an email now!" | |
# end | |
user = { | |
'name'=> 'jesse', | |
'email'=>'[email protected]', | |
'favorite food' => 'pizza' | |
} | |
p user | |
user['favorite food'] = "tacos" | |
user.merge! 'favorite car' => 'toyota' | |
user | |
p user | |
# magic | |
#p user | |
users = [ | |
{ 'name' => 'Jesse', | |
'email' => '[email protected]', | |
'favorite food' => 'pizza' }, | |
{ 'name' => 'Sean', | |
'email' => '[email protected]', | |
'favorite food' => 'yogurt' }, | |
{ 'name' => 'Mikael', | |
'email' => '[email protected]', | |
'favorite food' => 'yogurt' } | |
] | |
users.each do |u| | |
puts u['name'] | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment