Ruby returns the keys in any hash via the keys method:
x = { "a" => 1, "b" => 2, "c" => 3 } p x.keys
keys returns an array of all the keys in the hash.
values will return an array of all the values in the hash.
x = { "a" => 1, "b" => 2, "c" => 3 } p x.values