FANDOM


A hash in Ruby is used for indices other than the classic numerical values.

Here is a couple of example hashes

 grades = { "Jane Doe" => 10, "Jim Doe" => 6 }
 options = { :font_size => 10, :font_family => "Arial" }

Using a hash could look like this

 options[:font_size]  # => 10

External Links Edit

Ruby-Doc Hashes

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.