Glossary
- Hash - A collection of key-value pairs with unique keys.
- Hash Rocket - An operator for mapping keys to values in a hash:
=>.
Hash Methods
has_key?(key) - Returns a boolean indicating whether its argument is a key in the hash.
has_value?(val) - Returns a boolean indicating whether its argument is a value in the hash.
include?(key) - Returns a boolean indicating whether its argument is a key in the hash.
keys - Returns an array of all the keys in its receiver.
key?(key) - Returns a boolean indicating whether its argument is a key in the hash.
length - Returns the number of key-value pairs in its receiver.
to_a - Type converts its receiver hash into a nested array of [key, value] arrays.
to_h - Type converts a nested array of two-element arrays to a hash.
values - Returns an array of all the values in its receiver.
value?(val) - Returns a boolean indicating whether its argument is a value in the hash.