Hash (2)

I did another post with information about hash, I will put all the information found on the previous post plus more.

The same way that I mention on the previous, post of other elements of Ruby, Hash have also superpowers (A.K.A. Methods) on this post we will show some of this methods, for a more complete list of the methods follow the Ruby Iron-man Link below and  this 2nd-Link


Create a Hash

From “Array” to “Hash”

Array to Hash: Letter = Keys,   ASCII = Values

“Underworld” Form array to Hash and print organized

From 2 arrays to 1 HASH

Access data in a Hash.

Change(overwrite) data in a Hash

Add new data to Hash

Delete info in a Hash

Delete All Data of Hash

 

Join two Hashes

“.values”    &   “.keys”

“.key?”   &   “.value?”

Printing all the information of a Hash

”  ==  ”  to compare hash

 

 

 

 

 



Copyright 2017. All rights reserved.

Posted January 6, 2017 by Edmundo in category "Ruby