Skip to content

Instantly share code, notes, and snippets.

@emcoding
Last active August 29, 2015 14:19
Show Gist options
  • Save emcoding/df31e9cf1bb908741e1f to your computer and use it in GitHub Desktop.
Save emcoding/df31e9cf1bb908741e1f to your computer and use it in GitHub Desktop.
exercise 3 from chapter 4.6 Railstutorial
person1 = { :first => "Darth", :last => "Vader"}
person2 = { :first => "Claudia", :last =>"Cardinale"}
person3 = { :first => "Baby", :last => "InTheCorner"}
params = { :father => person1, :mother=>person2, :child=>person3 }
puts params[:father][:first] #puts print z ""
if params[:father][:first]==person1[:first]
"test geslaagd"
end
#I didn't iterate over the hashes, because I think the indexes in hashes are not fixed.?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment