Mega Code Archive

 
Categories / Ruby / Hash
 

Hash has a class method [], which is called in either one of two ways

myHash = Hash[ :name, "Jack", :partner, "Jane", :employee, "Joe", :location, "London", :year, 1843 ]