Last active
November 15, 2018 10:11
-
-
Save kbberker/76b274a4ef39faf6b92fb38873715392 to your computer and use it in GitHub Desktop.
Hash of wizards
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
wizards = { | |
"Harry" =>{ | |
:full_name => "Harry James Potter", | |
:age => 12, | |
:hair_colour => "brown", | |
:favourite_class => "Defence Against the Dark Arts" | |
}, | |
"Ron" =>{ | |
:full_name => "Ronald Bilius Weasley", | |
:age => 11, | |
:hair_colour => "ginger", | |
:favourite_class => nil | |
}, | |
"Hermione" =>{ | |
:full_name => "Hermione Jean Granger", | |
:age => 11, | |
:hair_colour => "brown", | |
:favourite_class => "Everything" | |
} | |
} | |
wizards["Harry"] | |
# => {:full_name=>"Harry James Potter", :age=>12, :hair_colour=>"brown", :favourite_class=>"Defence Against the Dark Arts"} | |
wizards["Harry"][:age] | |
#=> 12 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment