Hash Order
The keys and values methods of Hash each return an array so you can use various Array methods to manipulate them.
The Hash class has numerous built-in methods. For example, to delete an item using its key ( someKey ) from a hash, aHash, use aHash.delete( someKey ).
The comparison ‘operator’ <=> (which is, in fact, a method) is defined in the Ruby module named Comparable. For now, you can think of a module as a sort of reusable ‘code library’.
An Array is a sequential collection of items in which each item can be indexed.
# you can pass a block to the sort method of Array to determine how two consecutive elements are
As with strings , you can index from the end of an array using minus figures, where -1 is the index of the last element; and you can also use ranges