1. Technology
You can opt-out at any time. Please refer to our privacy policy for contact information.

Building Hashes

By

1 of 5

Building Hashes

A hash is an associative array. Instead of using numerical indexes, any object (but typically symbols) can be used. They can be both a fast way to retrieve an object based on a key, and a convenient key/value store. There's no doubt, hashes are one of the most used types in Ruby.

But how do you build a Hash? How do you insert data into it other than assigning keys to values one at a time? There are a few methods of building hashes you should know about.

  1. About.com
  2. Technology
  3. Ruby
  4. Beginning Ruby
  5. Building Hashes

©2014 About.com. All rights reserved.