Hash
Hashes contain key-value pairs.
hash = {a: 1, b: 2}
hash[:a] # => 1
hash[:b] # => 2
You can also write hashes with the arrow notation:
hash = { "a" => 1, "b" => 2}
hash["a"] #=> 1
hash["b"] #=> 2
Hashes in Ruby can contain more than strings and numbers. They can also contain symbols, booleans and objects including arrays and other hashes.
{
x: {},
y: [],
z: [ 1, 2, 3, { hi: "there"} ]
}